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

21,001 Responses

  1. The energy at Charlotte Dog Park is electric—my pup feeds off it and has a blast every time.

  2. Zqtrds表示:

    methylprednisolone generic – aristocort 10mg us aristocort pills

  3. TerryDus表示:

    http://tadalafileasybuy.com/# Tadalafil Easy Buy

  4. I’d need to test with you here. Which is not one thing I normally do! I enjoy studying a publish that will make individuals think. Also, thanks for permitting me to remark!

  5. Dwayneseisa表示:

    Generic 100mg Easy Generic100mgEasy buy generic 100mg viagra online

  6. I loved your article.Much thanks again. Cool.

  7. Bobbyaneno表示:

    этот контент мега сайт

  8. Hello, you used to write wonderful, but the last few posts have been kinda boring?K I miss your tremendous writings. Past several posts are just a bit out of track! come on!

  9. TerryDus表示:

    http://generic100mgeasy.com/# Generic100mgEasy

  10. Bobbyaneno表示:

    перенаправляется сюда мега ссылка

  11. TerryDus表示:

    https://tadalafileasybuy.com/# Tadalafil Easy Buy

  12. rpsexdoll表示:

    Hey, thanks for the blog post.Thanks Again. Will read on…

  13. WilliamNop表示:

    kamagra gel kopen: Kamagra Kopen Online – kamagra jelly kopen

  14. GregoryJough表示:

    KamagraKopen.pro: Kamagra Kopen Online – kamagra kopen nederland

  15. Kennethslity表示:

    https://generic100mgeasy.shop/# sildenafil 50 mg price

  16. GregoryJough表示:

    Officiele Kamagra van Nederland: Kamagra Kopen Online – Officiele Kamagra van Nederland

  17. Bobbyaneno表示:

    подробнее здесь мега сайт

  18. GregoryJough表示:

    KamagraKopen.pro: Kamagra – Officiele Kamagra van Nederland

  19. Excellent read, I just passed this onto a friend who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that: Thank you for lunch!

  20. WilliamNop表示:

    buy generic 100mg viagra online: Generic100mgEasy – Generic100mgEasy

  21. AdrianCet表示:

    Перейти на сайт мега сайт

  22. Bobbyaneno表示:

    Узнать больше магазин мега мориарти

  23. AdrianCet表示:

    проверить сайт mega зеркала

  24. WilliamNop表示:

    buy viagra here: buy generic 100mg viagra online – buy generic 100mg viagra online

  25. Bobbyaneno表示:

    этот сайт mega мориарти

  26. Bobbyaneno表示:

    кликните сюда мега мориарти

  27. Charlotte Dog Park is my pup’s weekly highlight—he starts whining to go days in advance.

  28. AdrianCet表示:

    перейти на сайт mega зеркала

  29. Kennethslity表示:

    https://kamagrakopen.pro/# kamagra kopen nederland

發佈留言

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