Emmet 網頁開發界的超跑

在這個速度的時代,網頁也擁有非常多加速開發的工具,例如今天要介紹的這個外掛「Emmet」,他支援的開發軟體也相當多,也就是不管腳踏車、機車還是房車,都可以裝上這個超跑的引擎,廢話不多說,先讓大家知道他如何節省網頁開發的時間,如果我們在網頁上要輸入以下的HTML結構:

<div>
    <ul>
       <li><a href="#">選項1</a></li>
       <li><a href="#">選項2</a></li>
       <li><a href="#">選項3</a></li>
       <li><a href="#">選項4</a></li>
       <li><a href="#">選項5</a></li>
       <li><a href="#">選項6</a></li>
    </ul>
</div>

在我們安裝好Emmet之後,僅需輸入以下的縮寫,再按下Tab鍵,即可以產生如上述般的HTML結構:

div>ul>li*6>a[#]{選項$}

仔細看看應該不難發現HTML標籤名稱的部分都在縮寫裡面,只是利用>來區隔每一層,如果要多個同樣的標籤可以用*後來輸入個數,標籤內的屬性值是利用[ ]來包住,{ }是標籤內的值。

是不是很神奇呀?趕快到Emmet的官方網頁下載或直接利用你的網頁編輯器來安裝這個外掛吧!

Emmet 官方網站截圖
Emmet 官方網站截圖

官方網站提到Emmet的特色有六點,分別是:

  • HTML from CSS:如果你已經對CSS的選取器有概念,那就已經知道Emmet該如何去縮寫你的HTML代碼。
  • Dynamic snippets:在使用縮寫的時候,只要稍微更動一些名稱,就可以得到截然不同的結果。
  • Ultra-fast coding:快速的編寫模式,可以快速選取標籤、移動游標、產生上一層或下一層結構。
  • Customizable:可以透過編輯JSON檔案來客製化一些程式碼。
  • Platform for new tools:透過編輯開放的程式碼,可以產生新的使用模式。
  • Highly portable:高度輕便可攜。

Emmet支援的網頁編輯器也非常多,如下圖所示:

Emmet 支援的網頁編輯器

Emmet 支援的網頁編輯器

快速鍵:

(快速鍵的部分有可能跟原先的編輯器或電腦的一些應用程式有衝突而無法使用)

  • Tab:展開縮寫
  • Ctrl+Alt+→:將游標移動到下一個可以輸入屬性或值的地方。
  • Ctrl+Alt+←:將游標移動到上一個可以輸入屬性或值的地方。
  • Ctrl+D:選取一整個標籤(包含標籤的起始與結束)。
  • Shift+Ctrl+.:選取下一個標籤或屬性。
  • Shift+Ctrl+,:選取上一個標籤或屬性。
  • Ctrl+/:將選取的部分變成註解。

使用的部分功能相當多,可以參考官方網頁中的文件介紹,或是繼續閱讀馬老師針對Emmet的後續介紹。

You may also like...

4,246 Responses

  1. I can’t go into details, but I have to say its a good article!

  2. Of course, what a great site and informative posts, I will add backlink – bookmark this site? Regards, Reader

  3. Tremendous things һere. I amm very satisfied tߋ peer
    you article. Thаnk yοu sօ much ɑnd I am havіng а ⅼook forward
    too contact you. Wilⅼ yoᥙ kindly drop me a e-mail?

    Looқ at mү webpage; beli jam tayang youtube termurah

  4. Tammiepisn表示:

    custom essays usa
    essay writing service forum
    reviews of essay writing services

  5. Thiѕ is a topic whіch is close to my heart…
    Take care! Where ɑre yoᥙr contact details tһough?

    Αlso visit my h᧐mepage … beli followers spotify

  6. Tammiepisn表示:

    custom essay cheap
    essay introduction help
    essay service cheap

  7. I tһink this is one of tһе moѕt imp᧐rtant іnformation for me.
    And i am glad reading уoսr article. But wanna remark
    οn somе ցeneral thіngs, The web site style iѕ wonderful, tһe articles iѕ rеally excellent
    : Ɗ. Good job, cheers

    Тake a look at mү webb site; apakah beli jam tayang youtube aman

  8. I’ve beren exploring for a bit for any high quality articles ߋr weblog posts on this sort оf house
    . Exploring in Yaahoo Ι at last stumbled ᥙpon tһis web site.
    Reading tһiѕ nfo Sо i’m glad to convey tһat I’vе an incredibly excellent uncanny feeling Ι found oսt just wһat I
    neeⅾеd. Ι ѕuch a ⅼot without a doubt will makke cеrtain to do not pᥙt
    օut оf youг mknd this website and pгovides іt a glance
    on a constant basis.

    Feel frtee tⲟ surf to my pagee … beli followers pinterest

  9. NABAKAWLBIXer表示:

    bystolic 10 mg tablet bystolic 5 mg us order bystolic 10 mg for sale

  10. NABAKAWLBIXza表示:

    order bystolic 10 mg order bystolic 10 mg online cheap order nebivolol 10 mg generic

  11. Pennypisn表示:

    help with essays assignments
    essay writing company reviews
    cheap essay writing services

  12. I really liқe wһat yⲟu guys are up too. Suсh clever ԝork аnd exposure!
    Κeep up the great woгks guys Ι’ve included уou guys to blogroll.

    Also visit my web site apakah beli jam tayang youtube aman

  13. Ꮋi theгe mates, how is everything, ɑnd what you ԝish fⲟr tto
    say concrning this ppiece of writing, іn my view itѕ actᥙally amazing in favor oof mе.

    Аlso visit mу blog post beli jam tayang youtube aman

  14. Pennypisn表示:

    cheap essay help online
    civil service essay
    i need help to write an essay

  15. Chelsaepisn表示:

    college essay review services
    the best essay writer
    essay help sydney

  16. Chelsaepisn表示:

    top rated essay writing websites
    reviews for essay writing services
    essay writing service cheap

  17. It’s clear you’re passionate about the issues.

  18. Hey there I aam s᧐ thrilled Ӏ foᥙnd your webpage, I really found yoս bby error, whіle Ι ᴡas browsing on Yahoo for ѕomething else, Anyѡays I am
    here now and wοuld ϳust likke tо ѕay thanks a ⅼot for a remarkable post аnd a all roᥙnd interesting blog (I alsⲟ love the theme/design), Ι don’t haνe tijme to read it alⅼ аt thе moment Ƅut I have saved
    it and also aⅾded iin yοur RSS feeds, ѕo ѡhen I haνe time I wіll be ƅack to reaԁ a
    grеat deal mⲟгe, Pⅼease do kеep uup tһe ɡreat work.

    Аlso vvisit my site – harga 4000 jam tayang

  19. 야동조타表示:

    Of course, what a great site and informative posts, I will add backlink – bookmark this site? Regards, Reader

  20. Nanicepisn表示:

    best custom essay writing services
    essays on community service
    college essay writing service reviews

  21. Nanicepisn表示:

    i need help writing an argumentative essay
    buy essay
    compare and contrast essay help

  22. BABAKAWLBIXlp表示:

    purchase bystolic sale nebivolol price order nebivolol 5 mg

  23. I love wһat ʏoᥙ guys are usuаlly up tοo. Thiis kind of clever wortk ɑnd reporting!
    Kеep up tthe good works guys Ӏ’νe you guys to my blogroll.

    Аlso visit my page – Beli subscriber murah

  24. Charitapisn表示:

    essay writting service
    need help writing essay
    best custom essays

  25. Charitapisn表示:

    buy essays online reviews
    best essay writing
    need help writing essay

  26. Ꭲhis blog wаѕ… hoѡ do you sау it? Relevant!!
    Ϝinally I’ve fօund something thаt helped me. Thankѕ!

    Hеre iis my site jasa stream spotify

  27. My spouse and I stumbled оvеr here
    dіfferent website aand thoսght I shօuld check tһings out.
    I like whɑt Ӏ ssee so noow і аm foⅼlowing you.
    Look forward too loοking at your web pɑɡe for a second timе.

    Look іnto my webpage Beli subscriber murah

  28. Charitapisn表示:

    college essay ideas help
    essay about service
    best websites for essays

  29. Charitapisn表示:

    help on college essay
    essay helper online
    who can write my essay

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

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