1. 程式人生 > >#WEB安全基礎 : HTML/CSS | 0x4HTML模塊化

#WEB安全基礎 : HTML/CSS | 0x4HTML模塊化

序列 phone gre 模塊 spa ron 雙引號 any why

想讓你的網頁變得整潔嗎?找我就對了,當然你會認識幾個新元素,和它們交朋友吧!

我幫你聯系一下這幾個新元素,這樣交朋友就變得簡單了

技術分享圖片

images裏放著圖片

技術分享圖片

以下是index.html的代碼

 1 <html>
 2 <head>
 3 <title>Sagway‘n USA</title>
 4 </head>
 5 <style>
 6 q{                <!--<q>標簽是小引用(沒有鎖緊,自動加雙引號)-->
 7 color: green;    <!--文字是綠色的-->
8 } 9 </style> 10 <body> 11 <h1>Segway‘n USA</h1> 12 <p> 13 Documenting my trip around the US on way my very own. 14 </p> 15 <h2>June 2, 2012</h2> 16 <img src = "images/trip.jpeg" title = "景點" alt = "經典" width = "200" height = "150"> 17 <p> 18 My first day of the trip! I can‘t believe I finelly got evetything packed and reddy to go. Because I‘m on a segway, I wasn‘t able to bring a whole lot with me:
19 <!--無序列表--> 20 <ul> 21 <li>cell phone</li> 22 <li>ipod</li> 23 <li>digital camera</li> 24 <li>a protein bar</li> 25 </ul> 26 Just the essentials.As Lao Tzu would have said, <q>A journey of a thousand miles begins with one step segway.</
q> <!--小的引用--> 27 </p> 28 <h2>July 14, 2012</h2> 29 <p> 30 I saw some Burma Shave stylesigns on the side of the road tody : 31 <blockquote> <!--大的引用(有縮進,沒有雙引號)--> 32 passing cars, When you can‘t see, May get you, A glirupse, of eternity. 33 </blockquote> 34 I definely won‘t be passing any cars. 35 </p> 36 <h2>August 20, 2012</h2> 37 <img src = "images/trip2.jpg" title = "我的車" alt = "我的車" width = "200" height = "150"> 38 <p> 39 Well I made it 1200 miles already, and I passed through some interesting places on the way: 40 <!--有序列表--> 41 <ol> 42 <li>Walla Walla, WA</li> 43 <li>Magic City, ID</li> 44 <li>Bountiful, UT</li> 45 <br><!--換行--> 46 <li>Last Chance, CO</li> 47 <li>Why, AZ</li> 48 <li>Truth or Consequences, NM</li> 49 </ol> 50 </p> 51 </body> 52 </html>

仔細閱讀並且理解註釋的意思。

li元素也可以單獨使用,不過建議你不要這麽做,因為模塊化是個信仰


下面來看看模塊化的網頁有多整潔吧

技術分享圖片

你也可以自己設計一套模塊


//本系列教程基於《Head First HTML與CSS(第二版)》,此書國內各大購物網站皆可購買


轉載請註明出處 by:M_ZPHr

最後修改日期:2019-01-16

#WEB安全基礎 : HTML/CSS | 0x4HTML模塊化