What is the shortest syntax of zen coding/ emmet for writing following html?

StackOverflow https://stackoverflow.com/questions/16606256

  •  29-05-2022
  •  | 
  •  

Question

What is the shortest syntax of zen coding/ emmet for writing following html?

<div id="main-wrapper">
    <div id="left">
        <div class="inner-wrapper">
            <div class="wrapper"></div>
        </div>
    </div>
    <div id="right">
        <div class="inner-wrapper">
            <div class="wrapper"></div>
        </div>
    </div>
</div>

I use following.

div#main-wrapper>(div#left>div.inner-wrapper>div.wrapper)+(div#right>div.inner-wrapper>div.wrapper)

I got result but I have to repeat the same inner content in both column. Is there any better way?

Was it helpful?

Solution

You can skip div:

#main-wrapper>(#left>.inner-wrapper>.wrapper)+(#right>.inner-wrapper>.wrapper)

Or, you can write

#main-wrapper>#*2>.inner-wrapper>.wrapper

...then traverse with Tab key (if your editor supports tab stops) or use Go to Edit Point action to move to generated empty id attributes and fill values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top