復制代碼代碼如下: html head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / title Text Demo /title /head body h1 >This is a line of Text. /h1 /body /html
嵌入式:嵌入式則將對頁面中各種元素的設置集中寫在 head 和 /head 之間,對于單一的網頁,這種方法很方便。但是對于一個包含很多頁面的網站,如果每個頁面都以內嵌方式設置各自的樣式,就失去了CSS帶來的巨大優點,因此一個網站通常都是編寫一個獨立的CSS樣式表文件,使用以下兩種方式中的一種,引入HTML文檔中。 例:
復制代碼代碼如下: html head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / title Text Demo /title style type="text/css" h1{ color:white; background-color:boue; } /style /head body h1 This is a line of Text. /h1 h1 This is another line of Text. /h1 /body /html