close
[CSS語法]CSS套用方式
直接套用方式
<p style='font-family:verdana; font-size:16;'>This is font size 16.</p>
嵌入式套用(先在網頁前宣告在 <head> 內 BODY之前)
範例:
<head>
<style type="text/css">
div {
background-color:#000000;
}
</style>
</head>
<body>
<div>
背景顏色是黑色
</div>
</body>
呼叫外部CSS語法(請放在body之前)
<link href="你的css檔案.css" rel="stylesheet" type="text/css">
外部網站的 CSS 樣式也可以被匯入進 HTML 文件。
匯入的做法為利用 @import 這個指令。@import 的語法為:
<STYLE TYPE="text/css">
<!--
@import url(http://www.mysite.com/style.css);
-->
</STYLE>
全站熱搜