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

4,589 Responses

  1. I discovered your blog site internet site on the search engines and check a few of your early posts. Always keep on the great operate. I simply additional encourage Feed to my MSN News Reader. Seeking forward to reading far more from you down the line!…

  2. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme? Exceptional work!

  3. Perhaps you should also a put a forum site on your blog to increase reader interaction.`-”..

  4. There a few interesting points in time here but I do not determine if these people center to heart. There may be some validity but I’m going to take hold opinion until I explore it further. Great post , thanks and now we want a lot more! Included with FeedBurner likewise

  5. Aw, this was a very nice post. In concept I want to put in writing like this moreover – taking time and actual effort to make a very good article… but what can I say… I procrastinate alot and under no circumstances seem to get something done.

  6. Awseome article, I am a big believer in posting comments on blogs and forums to help the blog writers know that they’ve added some thing of great benefit to the world wide web!

  7. Substantially, the post is in reality the greatest on this deserving topic. I concur with your conclusions and also will certainly eagerly look forward to your future updates. Saying thanks definitely will not simply just be adequate, for the exceptional clarity in your writing. I definitely will promptly grab your rss feed to stay abreast of any updates. Pleasant work and also much success in your business dealings!

  8. If you’re interested in having a guest blog websiteer please let me recognize. I’ll give you with unique content for your webstie, thanks.

  9. Phil Bilbrey表示:

    Oh my goodness! a tremendous article dude. Thank you Nevertheless I am experiencing situation with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting similar rss downside? Anybody who knows kindly respond. Thnkx

  10. Hi, i think that i saw you visited my blog thus i came to “return the favor”.I’m trying to find things to improve my site!I suppose its ok to use a few of your ideas!!

  11. Good day! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog article or vice-versa? My site discusses a lot of the same subjects as yours and I think we could greatly benefit from each other. If you’re interested feel free to send me an e-mail. I look forward to hearing from you! Superb blog by the way!

  12. i discover this extremely embarrasing but the product in my site link definitely served

  13. Surprisingly! It truly is as if you study my thoughts! A person seem to understand so a lot relating to this, exactly like you authored the book in it or even something. I feel which you can perform with some images they are driving the message property a bit, besides that, this really is good weblog. The outstanding study. I’ll undoubtedly review again.

  14. Thanks a lot for sharing this with all folks you actually know what you’re speaking about! Bookmarked. Please additionally consult with my website =). We can have a link exchange arrangement among us!

  15. Aw, this was a very nice post. In thought I wish to put in writing like this additionally ?taking time and actual effort to make an excellent article?but what can I say?I procrastinate alot and on no account appear to get one thing done.

  16. Aventura e diversao em um so cassino Blaze

  17. Hi there, You have done a great job. I will definitely digg it and personally recommend to my friends. I’m confident they’ll be benefited from this website.

  18. Good day, I just hopped over in your web site via StumbleUpon. Not something I would generally read, but I favored your emotions none the less. Thank you for making something value reading.

  19. there are many bargain priced home-for-sale in our city, i was considering buying one.

  20. I admit, I have not been on this webpage in a long time… however it was another pleasure to see It is such an essential topic and ignored by so numerous, even professionals. I thank you to help making people more aware of possible issueExcellent stuff as typical.

  21. Nice post. I learn some thing much harder on different blogs everyday. It will always be stimulating you just read content from other writers and use a specific thing from their store. I’d would prefer to apply certain together with the content in this little blog whether or not you don’t mind. Natually I’ll give you a link with your internet weblog. Many thanks for sharing.

  22. Appreciating the time and energy you put into your site and in depth information you provide. It’s great to come across a blog every once in a while that isn’t the same old rehashed material. Great read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  23. Hello there, have you by chance considered to publish regarding Nintendo or PS handheld?

  24. This web site is often a walk-through it really is the internet it suited you with this and didn’t know who to question. Glimpse here, and you’ll undoubtedly discover it.

  25. There are certainly loads of particulars like that to take into consideration. That could be a nice point to bring up. I offer the ideas above as basic inspiration however clearly there are questions just like the one you convey up the place a very powerful factor might be working in honest good faith. I don?t know if best practices have emerged round issues like that, but I am sure that your job is clearly identified as a good game. Each girls and boys really feel the impression of only a moment’s pleasure, for the remainder of their lives.

  26. What your stating is absolutely genuine. I know that everyone ought to say the identical factor, but I just feel that you set it in a way that absolutely everyone can realize. I also adore the photographs you set in here. They fit so nicely with what youre hoping to say. Im guaranteed youll attain so numerous people today with what youve got to say.

  27. Thanks for writing valuable post regarding the subject. I’m a fan of your site. Keep up the great work.

  28. Countless online communities include singles groupings of which attempt enjoyable fleshlights routines jointly, all this is actually is a great substitute internet dating process. Occurrences like pedaling, bowling, curling, film night time, dancing along with humor golf clubs are usually organized through the singles group, and it allows a evenly-distributed group of contributors to acquire an enjoyable and laid-back nights. Along with stress don your hobby by itself as an alternative to making a loving link, requires lots of pressure from the singles and points of interest occur a lot more obviously around this setting up.

  29. An exceptionally good post. This information sums up for me what this topic depends upon and some of the essential benefits that can be created from knowing about it as you. A friend once remarked that you have a totally different perspective when you do something for certain as opposed to when you’re just toying with it. In the case of this topic, I believe you are taking, or start to consider, a more professional in addition to thorough approach to either what and how you write, which in turn helps you to carry on and get better and help others who don’t know everything about what you have discussed here. Thank you.

  30. you can also look for ebay for some cheap wedding favors, i prefer to customize my wedding favors,

發佈留言

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