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

13,423 Responses

  1. Elroy Inscho表示:

    The unique viewpoints you bring to The writing are as captivating as The online presence. Always a pleasure.

  2. Jeffreywex表示:

    https://gramster.ru/# пин ап казино официальный сайт

  3. вывод из запоя стационар ростов вывод из запоя стационар ростов .

  4. RobertCow表示:

    пин ап казино: gramster – пин ап

  5. нарколог на дом вывод из запоя на дому нарколог на дом вывод из запоя на дому .

  6. Jamesboype表示:

    http://gramster.ru/# пин ап вход

  7. I love what you guys are up too. This sort of clever work and reporting! Keep up the amazing works guys I’ve you guys to my own blogroll.

  8. Jeffreywex表示:

    https://gramster.ru/# pinup 2025

  9. вывод из запоя в ростове [url=vyvod-iz-zapoya-rostov26.ru]вывод из запоя в ростове[/url] .

  10. RobertCow表示:

    pinup 2025: Gramster – пинап казино

  11. In America as of 2010, by the time your baby reached 18 years of age you’d have shelled out anyplace between $8,480 and $23,690 yearly for her expenses.

  12. DarrenWab表示:

    пин ап зеркало gramster пин ап казино

  13. WilliamDen表示:

    http://gramster.ru/# пин ап зеркало

  14. Jeffreywex表示:

    http://gramster.ru/# пин ап казино официальный сайт

  15. WilliamDen表示:

    http://gramster.ru/# пин ап казино зеркало

  16. DarrenWab表示:

    пин ап казино gramster pinup 2025

  17. Under US Common Accepted Accounting Principles (GAAP), non-money activities may be disclosed in a footnote or inside the money movement statement itself.

  18. Aurobindo Ashram is amongst probably probably the most well-recognized Vacationer Attractions Pondicherry where fact seekers from throughout the globe come to be taught the arts of living.

  19. In 1991, the company added the Versatile Bond Portfolio (PRVBX) which invests 80 or more of its internet belongings in bonds.

  20. Remember, improving your attachment type doesn’t have to be a solo effort.

  21. Article 1 Part 8 of the Structure reads, “The Congress shall have Power to lay and gather Taxes, Duties, Imposts and Excises, to pay the Debts and supply for the frequent Defence and common Welfare of the United States.” However, income tax as we understand it did not exist until the ratification of the 16th Modification, in 1913.S.

  22. China has formally overtaken Japan as the world’s second largest economic system, but its economic system is still only half the size of the United States’.

  23. The is the wealthy supply of the Agro product and one can the product in very cheaper charges as uncooked material for any agro-associated industry.

發佈留言

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