Home > database >  Element inside an Element Emmet
Element inside an Element Emmet

Time:11-15

How to do this Emmet format in VS Code?

<ul id="list-items">
  <li >Items 1<button >X</button></li>
  <li >Items 2<button >X</button></li>
  <li >Items 3<button >X</button></li>
  <li >Items 4<button >X</button></li>
</ul>

I've been trying to get the formula for this Emmet. I cant seem to declare a button inside a curly bracket(Text)

This Emmet
ul#list-items>(li.items{Items $} button.delete-btn{X})*4

Produces this one. Close but not quite;


<ul id="list-items">
 <li >Items 1</li>
 <button >X</button>
 <li >Items 2</li>
 <button >X</button>
 <li >Items 3</li>
 <button >X</button>
 <li >Items 4</li>
 <button >X</button>
</ul>

and if I ever try to declare a button inside a curly bracket

ul#list-items>li.items{Items $ button.delete-btn }*4

ul#list-items>li.items{Items $ button.delete-btn{X}}*4

ul#list-items>li.items{Items $ ^button.delete-btn{X}}*4

also tried;

ul#list-items>(li.items{Items $ button.delete-btn})*4

this is the thing that I produce:

<ul id="list-items">
 <li >Items 1 button.delete-btn </li>
 <li >Items 2 button.delete-btn </li>
 <li >Items 3 button.delete-btn </li>
 <li >Items 4 button.delete-btn </li>
</ul>

I removed the {X} on the Button since it doesn't execute if there is.

Also tried this

ul#list-items>li.items{Items $ (button.delete-btn{X})}*4

but can't execute. Even if I remove {X} on button.

CodePudding user response:

Try this:

ul#list-items>(li.items{Items $}>button.delete-btn{X})*4
  • Related