Emmet abbreviations- text inside an element tag

12.7k views Asked by At

Is there a way to encode text inside an element in Emmet. For example if I want to create a would this be possible with emmet abbreviations?

4

There are 4 answers

0
aphilas On

You can use curly braces to add text to an element.

For example article{This is some text inside an article} expands to <article>This is some text inside an article</article>

0
NIck Sh On

.item{My $ text}*3

<div class="item">My 1 text</div>
<div class="item">My 2 text</div>
<div class="item">My 3 text</div>
0
anonymous On
The first example starts from 1 and the second example starts from 6

ul>li.item$*5
<ul>
    <li class="item1"></li>
    <li class="item2"></li>
    <li class="item3"></li>
    <li class="item4"></li>
    <li class="item5"></li>
</ul>

ul>li.item$@6*5

<ul>
    <li class="item6"></li>
    <li class="item7"></li>
    <li class="item8"></li>
    <li class="item9"></li>
    <li class="item10"></li>
</ul>

0
mhermano On

You can insert lorem ipsum to tags, e.g.

li.text-warning>lorem10

Result:

<li class="text-warning">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex, molestias.</li>

Hope that workaround is ok.