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

6,931 Responses

  1. Sweet Bonanza Slot – Top 5 Reasons to Play Want to know why Sweet Bonanza is such a hit? We’ve compiled the top 5 reasons players love this game, from huge multipliers to the fun, candy-themed graphics.
    slot bonanza

  2. Gartandabsex表示:

    Лучшие свежие анекдоты и шутки
    Отдохни и посмейся

  3. Профессиональный сервисный центр по ремонту сигвеев в Москве.
    Мы предлагаем: срочный ремонт сигвея
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

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

  5. Sweet Bonanza Slot – Cascading Reels Explained Discover how Sweet Bonanza’s cascading reels work. With each winning combination, symbols disappear and new ones drop in, giving you even more chances to win in a single spin!
    slot bonanza

  6. WallySWOPE表示:

    Look of the Week: Forget the naked dress, Kendall Jenner makes the case for underwear as outerwear
    kraken тор браузер

    On Monday, Kendall Jenner stepped out onto the L’Oreal Paris womenswear runway in a scarlet red Mugler gown that might have looked familiar to anyone with a sharp memory of 1999.

    The front of the dress was slashed open across Jenner’s right shoulder, exposing a matching denier bra. The peekaboo moment conjured up memories of another example of fashionable flashing: Lil’ Kim’s purple embellished jumpsuit at the VMAs 26 years earlier. On the red carpet, Kim’s left breast was almost entirely revealed by an asymmetrical cut — a mirror image of Jenner’s neckline — save for a matching purple nipple pasty.
    Jenner’s Mugler moment was just the latest example of a resurging tendency for underwear as outerwear. At the Nensi Dojaka runway show in London earlier this month, boxy blazers were shrugged over strappy bras while paneled bustiers in sheer fabric were paired with capri trousers and reimagined as going out tops. Brasseries were even left exposed to the elements at Erdem — a departure for a house beloved by both British acting royalty (Kristen Scott Thomas) and actual royalty (the Duchess of Cambridge). Dolce & Gabbana got the memo, too, showing satin corsets, garter belts and Madonna-esque cone bras at Milan Fashion Week on Saturday. Florence Pugh even wore one of the label’s risque designs in her first British Vogue cover last week — the circle neckline of her puff-shouldered black dress scooping just above the belly button, acting as a full-frontal frame for her bra.
    But the trend extends beyond just the runways. During the first performance of her “Short n’ Sweet” tour on Monday, singer Sabrina Carpenter took to the stage in a custom Victoria’s Secret bodysuit and stockings. Hand-adorned with over 150,000 crystals, the strapless pink lace-trimmed leotard took over 140 hours to make. On Monday,YouTube star and singer Jojo Siwa inverted the fad by donning a codpiece for a headline-grabbing cover shoot with LadyGunn magazine. The 15th century undergarment was bedazzled with flesh-colored gemstones.

  7. Sweet Bonanza Jackpot – How Big Can You Win? Wondering how much you can win in Sweet Bonanza? Check out the maximum payout potential and find out how players are hitting the jackpot with huge multiplier bonuses.
    slot bonanza

  8. JeffreyDab表示:

    Look of the Week: Forget the naked dress, Kendall Jenner makes the case for underwear as outerwear
    кракен онион

    On Monday, Kendall Jenner stepped out onto the L’Oreal Paris womenswear runway in a scarlet red Mugler gown that might have looked familiar to anyone with a sharp memory of 1999.

    The front of the dress was slashed open across Jenner’s right shoulder, exposing a matching denier bra. The peekaboo moment conjured up memories of another example of fashionable flashing: Lil’ Kim’s purple embellished jumpsuit at the VMAs 26 years earlier. On the red carpet, Kim’s left breast was almost entirely revealed by an asymmetrical cut — a mirror image of Jenner’s neckline — save for a matching purple nipple pasty.
    Jenner’s Mugler moment was just the latest example of a resurging tendency for underwear as outerwear. At the Nensi Dojaka runway show in London earlier this month, boxy blazers were shrugged over strappy bras while paneled bustiers in sheer fabric were paired with capri trousers and reimagined as going out tops. Brasseries were even left exposed to the elements at Erdem — a departure for a house beloved by both British acting royalty (Kristen Scott Thomas) and actual royalty (the Duchess of Cambridge). Dolce & Gabbana got the memo, too, showing satin corsets, garter belts and Madonna-esque cone bras at Milan Fashion Week on Saturday. Florence Pugh even wore one of the label’s risque designs in her first British Vogue cover last week — the circle neckline of her puff-shouldered black dress scooping just above the belly button, acting as a full-frontal frame for her bra.
    But the trend extends beyond just the runways. During the first performance of her “Short n’ Sweet” tour on Monday, singer Sabrina Carpenter took to the stage in a custom Victoria’s Secret bodysuit and stockings. Hand-adorned with over 150,000 crystals, the strapless pink lace-trimmed leotard took over 140 hours to make. On Monday,YouTube star and singer Jojo Siwa inverted the fad by donning a codpiece for a headline-grabbing cover shoot with LadyGunn magazine. The 15th century undergarment was bedazzled with flesh-colored gemstones.

  9. WilliamAnedy表示:

    Откройте для себя vavada слоты с темой животных и выигрывайте!

  10. Stevecoalo表示:

    Look of the Week: Forget the naked dress, Kendall Jenner makes the case for underwear as outerwear
    Кракен тор

    On Monday, Kendall Jenner stepped out onto the L’Oreal Paris womenswear runway in a scarlet red Mugler gown that might have looked familiar to anyone with a sharp memory of 1999.

    The front of the dress was slashed open across Jenner’s right shoulder, exposing a matching denier bra. The peekaboo moment conjured up memories of another example of fashionable flashing: Lil’ Kim’s purple embellished jumpsuit at the VMAs 26 years earlier. On the red carpet, Kim’s left breast was almost entirely revealed by an asymmetrical cut — a mirror image of Jenner’s neckline — save for a matching purple nipple pasty.
    Jenner’s Mugler moment was just the latest example of a resurging tendency for underwear as outerwear. At the Nensi Dojaka runway show in London earlier this month, boxy blazers were shrugged over strappy bras while paneled bustiers in sheer fabric were paired with capri trousers and reimagined as going out tops. Brasseries were even left exposed to the elements at Erdem — a departure for a house beloved by both British acting royalty (Kristen Scott Thomas) and actual royalty (the Duchess of Cambridge). Dolce & Gabbana got the memo, too, showing satin corsets, garter belts and Madonna-esque cone bras at Milan Fashion Week on Saturday. Florence Pugh even wore one of the label’s risque designs in her first British Vogue cover last week — the circle neckline of her puff-shouldered black dress scooping just above the belly button, acting as a full-frontal frame for her bra.
    But the trend extends beyond just the runways. During the first performance of her “Short n’ Sweet” tour on Monday, singer Sabrina Carpenter took to the stage in a custom Victoria’s Secret bodysuit and stockings. Hand-adorned with over 150,000 crystals, the strapless pink lace-trimmed leotard took over 140 hours to make. On Monday,YouTube star and singer Jojo Siwa inverted the fad by donning a codpiece for a headline-grabbing cover shoot with LadyGunn magazine. The 15th century undergarment was bedazzled with flesh-colored gemstones.

  11. Sweet Bonanza Game Review – Our Expert Opinion Get the full review of Sweet Bonanza from our experts. We break down the gameplay, bonuses, and why this colorful slot is so popular among online players.
    slot bonanza

  12. WilliamAnedy表示:

    Ищете экзотические игры? Попробуйте casino slots animals и получите незабываемые эмоции.

  13. view and download instagram stories [url=anon-story-view.com]view and download instagram stories[/url] .

  14. xxxn video com [url=http://xxxvideospro.com]xxxn video com[/url] .

  15. Кодирование от алкоголизма цена в Астане [url=https://kodirovanie-ot-alkogolizma-astana.kz/]kodirovanie-ot-alkogolizma-astana.kz[/url] .

  16. Профессиональный сервисный центр по ремонту объективов в Москве.
    Мы предлагаем: ремонт диафрагмы объектива
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  17. Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
    Мы предлагаем:ремонт крупногабаритной техники в уфе
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  18. Профессиональный сервисный центр по ремонту серверов в Москве.
    Мы предлагаем: ремонт серверного оборудования
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  19. Sweet Bonanza Bonus Buy Feature – Is It Worth It? Thinking about buying your way into the bonus rounds in Sweet Bonanza? Discover how the bonus buy feature works and whether it can help boost your winnings.
    slot bonanza

  20. Armandoknot表示:

    Смешные картинки

  21. best instagram viewer [url=https://anonstoriesview.com/]best instagram viewer[/url] .

  22. instagram story viewer [url=http://www.anstoriesview.com]instagram story viewer [/url] .

  23. Ykdwjh表示:

    acticin generic – order retin online cheap retin us

  24. Sweet Bonanza Multipliers – Boost Your Wins! Multiply your winnings with Sweet Bonanza’s unique multiplier feature. Learn how to activate and maximize these powerful bonuses during your spins.
    slot bonanza

  25. Сервисный центр предлагает починить сигвей iconbit срочный ремонт сигвей iconbit

  26. Профессиональный сервисный центр по ремонту серверов в Москве.
    Мы предлагаем: цены на ремонт серверов
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  27. Профессиональный сервисный центр по ремонту серверов в Москве.
    Мы предлагаем: срочный ремонт компьютеров на дому
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  28. sweetbonanza表示:

    How to Play Sweet Bonanza – A Guide for Beginners New to Sweet Bonanza? Check out our beginner’s guide on how to play, understand the cascading reel mechanics, and make the most of your spins for bigger wins.
    slot bonanza

  29. Профессиональный сервисный центр по ремонту серверов в Москве.
    Мы предлагаем: вызвать мастера по ремонту сетевых хранилищ
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

發佈留言

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