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

23,603 Responses

  1. 亚博体育表示:

    I do consider all of the concepts you’ve presented to your post. They’re very convincing and will definitely work. Still, the posts are very brief for beginners. May you please prolong them a bit from next time? Thanks for the post.

  2. RobertRef表示:

    best price for Viagra: trusted Viagra suppliers – cheap Viagra online

  3. Ronaldpayon表示:

    http://modafinilmd.store/# buy modafinil online

  4. RobertRef表示:

    same-day Viagra shipping: same-day Viagra shipping – buy generic Viagra online

  5. RobertRef表示:

    FDA approved generic Cialis: discreet shipping ED pills – cheap Cialis online

  6. 亚博体育表示:

    Im grateful for the blog article.Thanks Again. Want more.

  7. JeremyMelty表示:

    cheap Viagra online: best price for Viagra – no doctor visit required

  8. Ronaldpayon表示:

    https://zipgenericmd.shop/# online Cialis pharmacy

  9. LorenzoLiate表示:

    generic tadalafil Cialis without prescription cheap Cialis online

  10. novoline表示:

    Thanks for sharing, this is a fantastic article.Much thanks again. Want more.

  11. AG 官网表示:

    I do agree with all of the ideas you’ve introduced on your post. They’re really convincing and will definitely work. Nonetheless, the posts are too quick for novices. May just you please lengthen them a bit from subsequent time? Thanks for the post.

  12. Carlospuh表示:

    нажмите здесь kra34 сс

  13. RobertRef表示:

    online Cialis pharmacy: Cialis without prescription – discreet shipping ED pills

  14. MichaelNam表示:

    узнать больше Здесь kraken

  15. LorenzoLiate表示:

    legal Modafinil purchase verified Modafinil vendors verified Modafinil vendors

  16. shedo表示:

    Here to explore discussions, share thoughts, and gain fresh perspectives along the way.
    I’m interested in hearing diverse viewpoints and sharing my input when it’s helpful. Happy to hear different experiences and connecting with others.
    Here is my site:https://automisto24.com.ua/

  17. RobertRef表示:

    no doctor visit required: same-day Viagra shipping – discreet shipping

  18. GeorgeLof表示:

    посмотреть на этом сайте kraken зеркало

  19. Anya112ma表示:

    Hello .!
    I came across a 112 helpful site that I think you should visit.
    This tool is packed with a lot of useful information that you might find valuable.
    It has everything you could possibly need, so be sure to give it a visit!
    https://thegameofnerds.com/2024/10/02/the-fusion-of-visual-novels-and-anime-exploring-the-emotional-depth-of-interactive-storytelling/

  20. Ronaldpayon表示:

    http://maxviagramd.com/# safe online pharmacy

  21. Carlospuh表示:

    Читать далее кракен сайт

  22. MichaelNam表示:

    ссылка на сайт kra33.at

  23. MichaelNam表示:

    Подробнее kra33 at

  24. 开云体育表示:

    Howdy! Do you use Twitter? I’d like to follow you if that would be ok. I’m undoubtedly enjoying your blog and look forward to new updates.

  25. GeorgeLof表示:

    узнать больше kra33 сс

  26. MichaelNam表示:

    узнать больше Здесь kraken shop

  27. Carlospuh表示:

    посетить сайт kra34 cc

發佈回覆給「GeorgeLof」的留言 取消回覆

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