以往寫網頁都是把 CSS Style 在 <head></head> 區段中載入, 今天發現在 <body></body> 區段中載入也是可以的.

另外如果不是要載入 CSS 檔, 而是要把 CSS Style 插入在 <body></body> 區段中, 則需要用 <div></div> 區段把 <style></style> 區段包住.

<head>
...
</head>
<body>
...
<!-- 可以在 <body></body> 區段中另外再載入 CSS 檔 -->
<link rel="stylesheet" href="mystyle.css" />
...
<div>
<style type="text/css">
/* local style sheet 要放在 <div></div> 區段中 */
.alt0 { backbround-color:#FCFCFC; }
.alt1 { background-color:#E8E8E8; }
...
</style>
</div>
...
</body>

arrow
arrow
    文章標籤
    HTML5 CSS body tag stylesheet
    全站熱搜

    MagicJackTing 發表在 痞客邦 留言(0) 人氣()