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...

11,923 Responses

  1. Thank you for sharing indeed great looking !

  2. Fifinepisn表示:

    top online casino
    us casinos online
    biggest online casino bonuses

  3. Thank you so much for sharing this wonderful post with us.

  4. A great post without any doubt.

  5. The information shared is of top quality which has to get appreciated at all levels. Well done…

  6. Sheelaghpisn表示:

    best vpn 2022 reddit
    vpn youtube free
    how to set up vpn

  7. A great post without any doubt.

  8. Sheelaghpisn表示:

    business vpn router
    zenmate vpn free
    free india vpn

  9. Fifinepisn表示:

    best online casinos for real money
    real online gambling
    online casinos free money

  10. Thank you so much for sharing this wonderful post with us.

  11. 匿名訪客表示:

    Thank you so much for sharing this wonderful post with us.

  12. 匿名訪客表示:

    Nice i really enjoyed reading your blogs. Keep on posting. Thanks

  13. https://mxguns.com/product/jts-group-m12ar-gray-12-ga-18-7-barrel-5-rounds/表示:

    Thank you so much for sharing this wonderful post with us.

    https://mxguns.com/product/mossberg-jm-pro-series-930-tactical-kryptec-typhon-camo-12-ga-24-inch-9rd/

  14. Nice i really enjoyed reading your blogs. Keep on posting. Thanks

  15. Laurellapisn表示:

    free india vpn
    best vpn router
    free vpn australia

  16. Carolinpisn表示:

    deposit casino bonus
    casino no deposit welcome bonus
    online casino bonuses

  17. Kelseypisn表示:

    strong vpn
    best free vpn for firestick
    best free vpn for linux

  18. RichardRof表示:

    вышка телескопическая
    https://www.podyemniki-machtovyye-teleskopicheskiye.ru/

  19. Nice i really enjoyed reading your blogs. Keep on posting. Thanks

  20. Ashleighpisn表示:

    free vpn app for windows
    vpn server
    best free vpn for netflix

  21. Carolanpisn表示:

    mobile casinos for real money
    free online games to win real money no deposit
    united states online casino

  22. Jenneepisn表示:

    buy vpn with bitcoin
    free vpn windows 10
    get us vpn service

  23. arcane jinx表示:

    The information shared is of top quality which has to get appreciated at all levels. Well done…

  24. Dışı ve/veya standart dozların üzerinde ilaç
    kullanımına izin verilmeyecektir. Ek-1: Endikasyon Dışı İlaç Kullanım Talep Formu.

  25. 匿名訪客表示:

    Thank you so much for sharing this wonderful post with us.

  26. Her şey perspektife dayanır: Gerçekliği gördüğümüz gözlükler.
    İnanılması zor görünmekle birlikte, belirli durumlar hakkında hissettiğimiz yol gerçekleşen olayın niteliğine
    bağlı değildir. Herhangi bir olay bize geldiğinde, yaşadığımız duygu,
    durumun her birinin yaptığı yorumlamaya bağlıdır.

  27. Dulceapisn表示:

    cash casino games
    free welcome bonus no deposit casino
    online casino bonus no deposit

  28. Dennisfup表示:

    мачтовый подъемник
    http://podyemniki-machtovyye-teleskopicheskiye.ru

發佈留言

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