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,427 Responses

  1. MichaelGeony表示:

    prescription drugs from canada https://xxlmexicanpharm.com/# mexican drugstore online

  2. Davidmoits表示:

    xxl mexican pharm: best online pharmacies in mexico – xxl mexican pharm

  3. MichaelGeony表示:

    canadian pharmacies not requiring prescription https://familypharmacy.company/# Online pharmacy USA

  4. Davidmoits表示:

    discount drug mart: cheapest prescription pharmacy – drugmart

  5. Ismaelfer表示:

    Today, I went to the beach with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!

    Wyoming Valley Equipment LLC

  6. OLaneevige表示:

    Hey I am so happy I found your webpage, I really found you by mistake, while I was browsing on Digg for something else, Regardless I am here now and would just like to say kudos for a incredible post and a all round enjoyable blog (I also love the theme/design), I don’t have time to go through it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the fantastic work.
    Wyoming Valley Equipment LLC

  7. Charleskepsy表示:

    cheapest pharmacy for prescriptions https://xxlmexicanpharm.shop/# xxl mexican pharm

  8. Porterfax表示:

    drugmart discount drugs discount drug pharmacy

  9. Your blog post was exactly what I needed to read right now. It’s amazing how you always seem to know just what to say.

  10. CoreySOB表示:

    Архангельские алмазы могут стать основой нового успеха для АО “АЛМАЗЫ ПОMORCKOГO KRAЯ”, которое запускает процедуру Pre-IPO с целью привлечения 1 миллиарда рублей на разработку перспективных участков и увеличение объемов добычи.
    Инвестиции в месторождение алмазов

  11. MichaelGeony表示:

    cheapest pharmacy for prescriptions without insurance https://megaindiapharm.com/# Mega India Pharm

  12. Круглосуточная поставка спиртного в Москве: удобство либо задача?

    Каким образом это функционирует?

    24-часовая доставка алкоголя в Москве производится посредством различные службы:

    Интернет-сервисы: Профильные веб-сайты и приложения, что дают широкий выбор спиртных напитков с доставкой в дом. Заведения общепита и бары: Отдельные заведения, обладающие лицензию для продажу спиртного, предлагают доставку их продукции в вечернее время суток. Курьерские службы: Компании, которые сотрудничают с лицензированными продавцами алкоголя и проводят поставку по требованию. Преимущества:

    Удобство: Шанс приобрести любимый напиток, не покидая из жилища, в любое время суток. доставка алкоголя – Сбережение времени: Не требуется терять время на визит в маркет, особенно в позднее время. Широкий выбор: Обширный выбор алкогольных продуктов, включая редкие и эксклюзивные предложения. Возможность для вечеринок и мероприятий: Быстрая поставка позволяет быстро добавить запасы алкоголя, если это потребуется. Минусы и противоречия:

    Законность: В России запрещена продажа спиртного в вечернее время (с 23:00 до 8:00). Сервисы доставки, которые предлагают 24-часовую доставку, часто применяют различные схемы, которые способны быть незаконными. Употребление спиртного: Легкий получение к спиртному в всякое время может способствовать увеличению потребления, что способен иметь отрицательные последствия на здоровья. Контроль над реализацией не достигшим совершеннолетия: Имеется риск, что курьеры способны не контролировать возраст клиентов, что может привести к реализации спиртного не достигшим совершеннолетия.

  13. Davidmoits表示:

    drugmart: discount drug mart pharmacy – drugmart

  14. Davidmoits表示:

    Online pharmacy USA: Best online pharmacy – family pharmacy

  15. Porterfax表示:

    discount drugs discount drugs canadian online pharmacy no prescription

  16. MichaelGeony表示:

    online pharmacy no prescription https://discountdrugmart.pro/# drug mart

  17. JeffreyDow表示:


    Временная регистрация в Москве – быстро и надежно!

    Нужна временная прописка для работы, учебы или оформления документов?
    Оформим официальную регистрацию в Москве всего за 1 день. Без очередей,
    с гарантией и юридической чистотой!

    1. Подходит для граждан РФ и СНГ
    2. Регистрация от 3 месяцев до 5 лет
    3. Легально, с внесением в базу МВД

    Работаем без предоплаты! Документы можно получить лично или дистанционно.
    Доступные цены, оперативное оформление!

    Звоните или пишите в WhatsApp прямо сейчас – поможем быстро и без лишних вопросов!
    Временная регистрация в Москве

  18. WillieRap表示:

    buying prescription drugs in mexico online: mexican rx online – xxl mexican pharm

  19. Williamlig表示:

    These apes can tell when humans don’t know something, study finds
    гей член
    Some great apes realize when a human partner doesn’t know something and are capable of communicating information to them to change their behavior, a new study shows.

    Researchers from Johns Hopkins University studying bonobos found that they would point to where treats were hidden if they could see their human partner didn’t know where they were, according to a statement from the university, published Monday.

    Working with three male bonobos, study co-author Luke Townrow, a Johns Hopkins PhD student, would sit across a table from one of the animals as another person placed a treat under one of three cups.
    In some cases, Townrow would be allowed to see which cup the treat was under, and the bonobo would wait for him to pass it the food.

    At other times, he would not be able to see where the treat was, and the bonobo would point to the right cup to help him find the food.

    The “seemingly simple experiment that demonstrated for the first time that apes will communicate unknown information in the name of teamwork,” the statement reads.

    And study co-author Chris Krupenye, a Johns Hopkins assistant professor of psychological and brain sciences, told CNN that the study “is one of the clearest pieces of evidence that a non-human primate understands when someone else is ignorant.”

    This ability to intuit gaps in others’ knowledge is known as theory of mind.

    “As humans we have theory of mind, the ability to think about others’ perspectives,” Krupenye told CNN on Tuesday.

  20. Davidmoits表示:

    xxl mexican pharm: xxl mexican pharm – xxl mexican pharm

  21. Davidmoits表示:

    xxl mexican pharm: buying from online mexican pharmacy – xxl mexican pharm

  22. Kevinnem表示:

    ??????? ????????? ????? ?? ?? ?????????
    ?? ????? ???? ??? ????? ??????? ???????
    ??? ??????? ?????? ?????????? ???? ??? ?? ????? ?????? ?????? ?????????? ????? ???? ??«???? ???» ????? ?? “????? ?????”. ????? ?? ??????? ???? ????? ?????? ??????? ???????? ?????? ??? ????? “?????? ???????” (Zheleznaya Stavka) ??????????? ??????????? ?????? ??????? ???????? ???????/???????? ???????? (Phishing)? ?????? ?????? ????? ???????? ??? ????? ?????? ?? ???.
    ?? ??? ???? ????? ?????? ??????? ???? ???? ??? ??????? ???? ?????? ?????? ????????? ??? ????? – ??????? ?????? ????? – ?? ??? ????? ????? ????? ?????.

    ???????? ?????? ????????
    ?????????? ??? ?? ?????? ????? ??????? ??? ???? ?????? ?? ?????? ????? ????? ??? ???????? ???????.
    ???? ????? ???? ??????? ?? ???? ???????? ???? ????? ?? ?????? ???? ???????? ?? ????? ???????? ?????? ??????? ??? ?????? ???????? ???? ?????? ???????? ?? ????? ?? ??????? ???????? ?????? ?? ???? ?? ????? ?????????.

    ?????? ??? ??????? ??????????
    ???? ????????? «?????? ???????» ???? ??????? ????? “????” ???????? ??????? “???????” (???? ??????? ?????????) ????? ????? ??? ???????? “??????” ?? ?????? ?????? ??????????? ????????? ????? ????????? ????.
    ???? ?????? ??????? ?? “???????? ???????” ?? ???????????? ??? ????? ????? ??????? ??? ????? ???????? ??? ????: ????? ??????? ???? ????????? “???????” – ???? ??? ????????? “??????” – ?? ?? ?????? ??.
    ?????? ?? ????? ????????? ????? ??????? ??????: ?????? ?????? ????? ??????? ????? ??? ????? ??? ?????. ???? ???? ??????? ???? ??? ??????? ??????.

    ??????? ????????? ?? ???
    ?? 1 ????? 2025? ???? ??????? ?? ????????? ??????? ??????? ?? ??? ?????? ???? ?? ???? ?? ?????? ???? ?????? ????? ???? ??????.
    ?????? ??? ????????? 12 ???? ????? ??? ??? ????? ??? ????? ????????? ??? ????? ???? ??? ??????? ??? ????? ?????? ??????? ?? ????????. ??? ????? ?? ??????? ?????? ???????? ????????? ??? ??????? ???????? ?? ????????? ????? ????? ???? ????? ????? ?? ????????? ??? ????? ???? ??????? ????? ?????????? ??????.
    ???? ??? ?? ??? ?? ??? ???????? ?? ??? ????? ???? ??? ????? ?? ????? – ?? ???? ????? ??? ?????? ??????? ?????? ??????? ?????????? ????????? ???????? ????? ???? ??????? ?? ????????. ???? ???? ???? ?????? ?? ????? ?????? ?????? ?????? ?? ???? ????? ??? ??????.
    ???? ????????? ???? ???? ????????? ????? ???????? ?? ??? ????? – ???????? ???? ?????? ?? ???????. ???? ??? ?? ????? ??????? ?????? ????? ??? ???? ???????? ?? ??? ?? ????? ??????? ?? ?????
    ??? ????? ??? ????? ???? ????? ??????? ?? ?????? ????? ?? ?????? ??? ????? ????? ??????? ??? ?????. ??? ???? ???? ??????? ?????? ????.
    ???? ????? ?????? ???? ????????? ????? ?? ??? ??????? ???? ??????? ??? ?? ?????? (?? ???????) ?? ??? ????? ????????? ????? ???????? ??????? ??????? ??? ????? ?? ???????? ?????????.
    ???? ???? ????????? ???? ????????? ????? ??????? ?????? ?????? ????? ????? – ???????? ???? ?? ??? ?? ??? ???? ????? ????.

    ???????? ?? ????
    ?? ???? ????? ??????? ???? ????????? ??????? ????????? ????? ???????? ??? ????? ??? ?????? ??? ???????? ?????? ?????? ???? ???????? ?? ?????? ??????? – ??? ?? ??? ?????? ????? – ????? ??? ?????. ????? ????????? ???? “?????” ?? ????? ??? ???? ????? ???? ??? ????? ????? ?????.
    ??? ??????? ??? ???? ?????? ????? ?? ???? ????? ?? ?????? ????? ?????? ?????: ??????? ?? ?????? ?????? ???????? ??????.
    ??? ????? ??? ???? ??? ???? ?? ??? ????? ??????? ?? ????? ???????? ???????? ???? ???? ????? ?? ??????????. ????? ???? ???? ??????? ????????? ??? ????? ?? ???.
    ?? 2022? ?????? ????? ??? ????? ?????????? ???? ?? ???? ???? ???????? ??? ??????? ?? ???? ??? ?????? ??????? ???????? ?? ???? ???? ?????? – ??? ?????? ?????? ????. ??? ????????? ???????? ???????? ???? ??? ?????? ???????? ??????? ?????? ??????? ?????? ????? ?????????.
    ????? ????????? ??? ????????? ??? ????? ???? ?? ????? ????? ??? ??? ????? ???????? ?????????? ????? ?? ??? ????? ?????? ?? ???????? ?? ?????? ???? ?????? ???? ?????? ????? ????????? – ??? ??? ?????? ???????? ????? ????.
    ???? ?????? ????? ?????? ??????? ??????? ??? ?????? ?? ????? ????? ???? ??????. ???? ?????? ??????????? ?? ??????? ?? ????? ???? ???? ????? ????? – ??? ???? ????? ????? ??????? ???? ????????? ???? ????? ???? 2022 ??? ?? ?????? ?? ????? ??????? ??????? ??????. ??? ???? ????? ?????? ??? ???.
    ?????? ????? ????????? ????? ??????? ??????? ??? ?????? ???? ?? ??? ????? ?????? ???? ?????? ????? ??? ???? ???? ??????? ???? ???? ????? ??20 ????? ???? ?? ?????? ????????? ???? ???? ????? ?? ????? – ??? ??? ????? ???? ????? ??? ????? ?? ?????? (???? ????? ??? ??????? ??? ????).

    ???????? ?? ??????
    ??? ????????? ??????? ?? ??? ???? ???? ?? ????? ???????? ?????????? ????? ?????? ????? ??? ?????. ???? ??? ????? ???????? ???? ??????? ???? ??? ???? ???? ?????? ?? ??? ???????? ??? ??????.

    ?????? ???????? ?? ?????
    ??? ????????? ?? ???? ????? ???? ??? ???? ???? ????? ??? ????? ?? ?? ???????.

    ??? ??? ?????? ?? ?????? ?????????
    ??? ?? ???? ???? ????? ???? ????? ????????? ?????? ?????? ????? ????? ?????? ??? ????????? ?? ??? ???????? ?? ??? ??? ??????. ????????? ???? ??????? ??? ???? ??????? ?? ???.

    ?????? ?? ?????????
    ????? ????????? ???? ?????? ???????? ??? ???? “??? ?????? ????????” ?”????? ?????”.
    ??? ???? ????? ????????? ?????? ????? ??????? ??????? ??????.

    #??????_?????????

  23. WillieRap表示:

    canadapharmacyonline legit: easy canadian pharm – easy canadian pharm

  24. MichaelGeony表示:

    cheapest prescription pharmacy http://discountdrugmart.pro/# drugmart

  25. MichaelGeony表示:

    prescription drugs from canada https://megaindiapharm.shop/# Mega India Pharm

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

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