HTML5:Details元素

來源:互聯網
上載者:User

標籤:http   io   ar   os   使用   java   sp   div   on   

 

 教程細節
• 概要:HTML5的Details標籤
• 難度:初級
• 支援的瀏覽器:Chrome 12以上的版本
我最喜歡的HTML5新標籤是details元素,它剛剛被整合到Chrome最新的12版中。我將會在今天的快速入門中展示如何來使用它。
________________________________________
Details標籤可以用來做什嗎?
它本質上允許我們在點擊標籤時顯示和隱藏內容。你一定相當熟悉這種效果,但是直到現在,它總是用Javascript實現的。想象頭部之後有一個箭頭,當你點擊它時,下面的附加資訊將會呈現。再次點擊箭頭內容消失。FAQ頁面中經常使用這個功能。Details元素允許我們完全拋開Javascript。或者說,它將做到這樣,因為瀏覽器的支援還乏善可陳。________________________________________
一個樣本
現在讓我們深入和學習如何使用這個新標籤。我們從建立一個新的details元素開始。

然後,我們需要放入summary的內容。
Who Goes to College? 
< p> Your mom. 

< /details>好,讓我們開始一些更實用的例子。我想要使用details元素顯示不同的Nettuts+文章。我們首先為每一篇文章建立一個標記。
< summary>Dig Into Dojo
< img src=”http://d2o0t5hpnwv4c1.cloudfront.net/1086_dojo/dojo.jpg” alt=”Dojo” />

< h3> Dig into Dojo: DOM Basics 
< p>Maybe you saw that tweet: “jQuery is a gateway drug. It leads to full-on JavaScript usage.” Part of that addiction, I contend, is learning other JavaScript frameworks. And that’s what this four-part series on the incredible Dojo Toolkit is all about: taking you to the next level of your JavaScript addiction.
< /p>
< /div>
< /details>

詳細說明:http://html5.662p.com/thread-12-1-1.html

HTML5:Details元素

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.