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

1,077 Responses

  1. Admitle表示:

    best way to take lasix Non coding RNAs in Development and Disease Background, Mechanisms, and Therapeutic Approaches

  2. XsaYrolLiZgt表示:

    On this site u can buy all known killa snus for very good price!

  3. Weageby表示:

    lasix water pill Effects of estrogen with and without progestin on urinary incontinence

  4. Ginniepisn表示:

    professional essay writer
    professional essay writing services
    help with argumentative essay

  5. DABAKAWLBIXcz表示:

    order neurontin sale order gabapentin 100 mg for sale buy gabapentin 400 mg generic

  6. XsaYaylLiZgt表示:

    On this site u can buy all known KILLA COLD MINT for very good price!

  7. VABAKAWLBIXrl表示:

    diovan 160 mg us valsartan 80 mg for sale diovan for sale

  8. Ginniepisn表示:

    i need help with my college essay
    fast essay writing service
    custom essays for cheap

  9. Cthrinepisn表示:

    essay helper app
    help in essay writing
    essay homework help

  10. Cthrinepisn表示:

    essay writer service
    pay for essay writing
    buy essays online for college

  11. Leilahpisn表示:

    essay writing service law
    custom essay UK
    essay online help

  12. I’ve been searching for hours on this topic and finally found your post. baccaratcommunity, I have read your post and I am very impressed. We prefer your opinion and will visit this site frequently to refer to your opinion. When would you like to visit my site?

  13. Leilahpisn表示:

    college essay service
    admission essay editing service
    essay help introduction

  14. Twylapisn表示:

    buy custom essays online
    what is the best custom essay writing service
    customer service essays

  15. Twylapisn表示:

    helping others essay
    best essay writing websites
    fast custom essay

  16. Dronapisn表示:

    cheap custom essay writing services
    custom essay writing online
    academic essay writing help

  17. XsaYgylLiZgt表示:

    On this site u can buy all known EXTREME X LIME for very good price!

  18. Dronapisn表示:

    essay writer cheap
    research essay help
    help writing essay

  19. Charopisn表示:

    law essay help
    buy custom essay online
    act essay help

  20. casinosite表示:

    When I read an article on this topic, casinosite the first thought was profound and difficult, and I wondered if others could understand.. My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?

  21. Charopisn表示:

    essay writting services
    persuasive essay helper
    custom essay meister review

  22. Rhiamonpisn表示:

    buy cheap essays online
    help with college essays
    essay on helping others

  23. DABAKAWLBIXxb表示:

    diovan 80 mg canada buy diovan 80 mg valsartan usa

  24. Rhiamonpisn表示:

    are essay writing services legal
    personal essay writing service
    custom law essays

  25. Antoniepisn表示:

    best online essay editing service
    help to write an essay
    order essay online cheap

  26. XsaYaylLiZgt表示:

    On this site u can buy all known KILLA FLASH 4mg for very good price!

發佈留言

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