DEV Community

Cover image for If You Use Visual Studio Code . Know these Shortcuts
Chelsea Chemweno
Chelsea Chemweno

Posted on

If You Use Visual Studio Code . Know these Shortcuts

Knowing Visual Studio code shortcuts will save you more time than you can imagine when writing your codes . Checkout some of these shortcuts you can try in order to save on time.

Image description

1. ID and Class Attributes

• Adding an Id attribute in an HTML tag
(div#info)

<div id="info"></div>
Enter fullscreen mode Exit fullscreen mode

• Adding a class attribute to a html tag
(div.header)

<div class="header"></div>
Enter fullscreen mode Exit fullscreen mode

• Adding an Id and a class attribute
(Form#.info)

<form action="" id="" class="info"></form>
Enter fullscreen mode Exit fullscreen mode

• Adding multiple Id and class attributes
(p.info1.info2.info3.info4#info)

<p class="info1 info2 info3 info4" id="info"></p>
Enter fullscreen mode Exit fullscreen mode

2.Item Numbering

• Adding an ordered number of class names to the child elements.
(ul>li.items$*5)


<ul>
    <li class="items1"></li>
    <li class="items2"></li>
    <li class="items3"></li>
    <li class="items4"></li>
    <li class="items5"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

3.Child elements in the same class (Implicit Tag names )

(ul>.item)

<ul>
    <li class="item"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode
             OR
Enter fullscreen mode Exit fullscreen mode

(table>.row>.col*3)

<table>
    <tr class="row">
        <td class="col"></td>
        <td class="col"></td>
        <td class="col"></td>
    </tr>
</table>
Enter fullscreen mode Exit fullscreen mode

4.Putting Into Groups

(div> (header>ul>li*2>a) +footer>p)

<div>
    <header>
        <ul>
            <li><a href=""></a></li>
            <li><a href=""></a></li>
        </ul>
    </header>
    <footer>
        <p></p>
    </footer>
</div>
Enter fullscreen mode Exit fullscreen mode

5.HTML tag with a text

(a{Google})

`<a href="https://www.google.com/">Google</a>`
Enter fullscreen mode Exit fullscreen mode

6.Adding a HTML tag to another HTML tag (Siblings)

(div+sec+p)

<div></div>
<sec></sec>
<p></p>
Enter fullscreen mode Exit fullscreen mode

7.Adding Child and Parent Elements

•Adding multiple child elements

(ul>li*)

<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>

Enter fullscreen mode Exit fullscreen mode

•Adding child elements to the parent elements

(ul>li)

<ul>
    <li></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)