Emmet 介紹 – 縮寫篇

縮寫這樣的編輯方式是Emmet的核心功能,可以在輸入簡短的代碼後轉換成結構複雜的HTML,而且使用方式跟使用CSS的選取器雷同,所以非常易於使用。例如:

page>div.logo+ul#navigation>li*5>a{Item $}
------

<div id="page">
    <div class="logo"></div>
    <ul id="navigation">
        <li><a href="">Item 1</a></li>
        <li><a href="">Item 2</a></li>
        <li><a href="">Item 3</a></li>
        <li><a href="">Item 4</a></li>
        <li><a href="">Item 5</a></li>
    </ul>
</div>

以下分別介紹各種不同的縮寫撰寫模式

子結構:>

div>ul>li
------

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

同層結構:+

div+p+bq
------

<div></div>
<p></p>
<blockquote></blockquote>

上一層:^

div+div>p>span+em^bq
------

<div></div>
<div>
    <p><span></span><em></em></p>
    <blockquote></blockquote>
</div>
div+div>p>span+em^^^bq
------

<div></div>
<div>
    <p><span></span><em></em></p>
</div>
<blockquote></blockquote>

乘法:*

ul>li*5
------

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

分組:( )

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>
(div>dl>(dt+dd)*3)+footer>p
------

<div>
    <dl>
        <dt></dt>
        <dd></dd>
        <dt></dt>
        <dd></dd>
        <dt></dt>
        <dd></dd>
    </dl>
</div>
<footer>
    <p></p>
</footer>

項目編號:$

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$$*5
------

<ul>
    <li class="item001"></li>
    <li class="item002"></li>
    <li class="item003"></li>
    <li class="item004"></li>
    <li class="item005"></li>
</ul>
ul>li.item$@-*5
------

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

<ul>
    <li class="item3"></li>
    <li class="item4"></li>
    <li class="item5"></li>
    <li class="item6"></li>
    <li class="item7"></li>
</ul>
ul>li.item$@-3*5
------

<ul>
    <li class="item7"></li>
    <li class="item6"></li>
    <li class="item5"></li>
    <li class="item4"></li>
    <li class="item3"></li>
</ul>

內容:{ }

a{Click me}
------

<a href="">Click me</a>
p>{Click }+a{here}+{ to continue}
------

<p>Click <a href="">here</a> to continue</p>

ID and Class

div#header+div.page+div#footer.class1.class2.class3
------

<div id="header"></div>
<div class="page"></div>
<div id="footer" class="class1 class2 class3"></div>

自訂屬性

td[title="Hello world!" colspan=3]
------

<td title="Hello world!" colspan="3"></td>

You may also like...

14,179 Responses

  1. 強かっ表示:

    Indeterminate, optimistic: there are higher and cheaper vitality sources.

  2. By the mid-1980s, local leaders launched Vision 2000, an effort to revitalize and reinvent Chattanooga’s culture and financial system.

  3. Running on standard gas, the V6 Chevy Impala, for example, is rated at 21 mpg city/31 highway.

  4. In the UK the statistics have lagged behind the anecdotal signs of the same factor.

  5. They use necessary technique and tools to formulate strategic profit for the corporate.

  6. Do you know this state that held the Winter Olympics in 2002?

  7. Central Financial institution of Brazil, the Financial Authority of Singapore, and the Financial institution of Korea amounting to $60 billion each.

  8. Callum Twomey (four September 2018).

  9. Since none of these gadgets have cash worth in the real world, any income or assets earned from the game can’t be taxed.

  10. 無心な人表示:

    Above are the most important reasons that firms are selecting offshore income cycle management system.

  11. Switching between programs is straightforward as effectively — programs appear as cards on the display screen.

  12. KennethPah表示:

    how to get clomid pills clomid on pharm can i order clomid pill

  13. SamuelBix表示:

    where can i get clomid: clomidonpharm – can you get clomid for sale

  14. The restaurant’s menu options an array of traditional and progressive karahi dishes, every prepared with a give attention to capturing the genuine essence of this beloved Pakistani culinary tradition.

  15. Acquisitions many a occasions are compelled so as to benefit huge firms at market place.

  16. INA reported 2021 revenues of kn22.719 billion.

  17. вывод из запоя на дому в краснодаре вывод из запоя на дому в краснодаре .

  18. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали ремонт стиральных машин lg, можете посмотреть на сайте: ремонт стиральных машин lg
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  19. SamuelBix表示:

    amoxicillin 500mg tablets price in india: where can i buy amoxicillin without prec – amoxicillin 500 mg for sale

  20. Nonetheless, at the initial stage it’s a must to be very cautious and you can begin the strategy of fund allocation along with an professional solely.

  21. 南行徳 桜表示:

    In line with research of The International Financial Fund (IMF), the development in MENA area might be superior to the world standard during 2009 and 2014 for non-public equity in Middle East.

  22. Of course, searching out Pokemon will be truly taxing to your telephone’s battery.

  23. Certainly one of the best methods to get wholesome foods for much less is to easily make sure that you purchase in season, when there’s the best supply of the food and it is transport from close by.

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。