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

17,275 Responses

  1. выведение из запоя воронеж стационар https://sportandpolitics.ukrbb.net/viewtopic.php?f=24&t=17825/ .

  2. вывод из запоя в стационаре анонимно https://www.golosa.ukrbb.net/viewtopic.php?f=3&t=7471 .

  3. вывод из запоя в стационаре анонимно recordrpservak.ukrbb.net/viewtopic.php?f=31&t=1161 .

  4. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали сервисный центр lg в москве, можете посмотреть на сайте: сервисный центр lg
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  5. Rufussloft表示:

    Denmark’s Victoria Kj?r Theilvig wins Miss Universe 2024
    русский анальный секс

    Victoria Kj?r Theilvig of Denmark has been crowned Miss Universe 2024, becoming the first Dane to ever win the competition.

    The 21-year-old, a competitive dancer, entrepreneur, and aspiring lawyer, beat more than 120 other contestants to win the annual beauty pageant in Mexico City on Saturday night.

    She was applauded by other contestants on stage as she accepted the tiara from reigning titleholder Sheynnis Palacios of Nicaragua.

    This year’s finale featured a performance by singer Robin Thicke and was hosted by “Saved by the Bell” star Mario Lopez and former Miss Universe Olivia Culpo.

    The glitzy pageant began with contestants being narrowed down to a shortlist of 30, based on the results of Thursday’s preliminary event, which included a flamboyant national costume contest. The semi-finalists then paraded in swimwear, before 12 of them advanced to an evening gown contest.
    When later asked what she would say to those watching, Theilvig urged viewers to “keep fighting … no matter where you come from.”

    “I stand here today because I want a change, I want to make history, and that’s what I’m doing tonight,” she said.

    Chidimma Adetshina of Nigeria finished as first runner-up and Maria Fernanda Beltran of Mexico was named second runner-up. Suchata Chuangsri of Thailand and Ileana Marquez Pedroza of Venezuela followed – with Pedroza, a 28-year-old mother, making history in the top five after the competition removed several restrictions in recent years.

    This year marked the first time in Miss Universe’s 72-year history that women aged over 28 were permitted to enter. More than two dozen of the finalists were older than would have been allowed in previous years, with Malta’s Beatrice Njoya becoming the first and only woman in her 40s to reach the grand finale.

  6. DarrenUnjuh表示:

    https://cytpremium.com/# Abortion pills online

  7. Sazreuy表示:

    Как быстро и легально купить аттестат 11 класса в Москве
    psorum.ru/member.php?u=4348

  8. The insights are like a favorite book; I find new treasures each time I return.

  9. Lxfqpu表示:

    гѓ—гѓ¬гѓ‰гѓ‹гѓійЂљиІ©гЃЉгЃ™гЃ™г‚Ѓ – ドキシサイクリン и–¬е±ЂгЃ§иІ·гЃ€г‚‹ アキュテイン жµ·е¤–йЂљиІ©

  10. AlbertDuM表示:

    ivermectin lotion: iver fast – buy minocycline 50mg online

  11. Узнай все о сколько стоит увеличение полового члена клиника по увеличению пениса

  12. Most Popular Apps to Make Money in Pakistan, Worth Trying, That You Didn’t Know About, Ideal Options for Making Money in Pakistan, Popular Apps to Make Money in Pakistan, with a high rating and positive reviews, Safe ways to earn money in Pakistan through applications, with a guarantee of payments, which change the idea of ????earning money, Reliable apps for making money in Pakistan: choose the best, for active participation in earnings, Promising apps for making money in Pakistan, How to make money in Pakistan using mobile apps: simple and profitable, with great potential for earning, which will suit every user, with a high level of security, for beginners and experienced users, to improve financial situationhow to earn money online in pakistan for students free earning app in pakistan .

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

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

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