CSS 样式表设定有三种方法:
使用 CSS 文件需要在 HTML 的头部引用,格式如下:
<head> <link rel="stylesheet" type="text/css" href="文件名.css"> </head> |
选择符1 { 属性1
: 值1 ; 属性2: 值2; }
选择符2 { 属性1 : 值1 ; 属性2: 值2; } |
body { background: #FFFFFF; color: #000000; /*font-size: 75%; */ /* K2 and Proxy */ background-repeat:no-repeat; font-family: 宋体; font-size: 75%; /* SMS, NT5, and Win98 */ } |
<head>
<title>文档标题</title> <style type="text/css"> <!-- body {font: 10pt "Arial"} h1 {font: 15pt/17pt "Arial"; font-weight: bold; color: maroon} h2 {font: 13pt/15pt "Arial"; font-weight: bold; color: blue} p {font: 10pt/12pt "Arial"; color: black} --> </style> </head> |
<p style="margin-left: 0.5in; margin-right:0.5in">这一行被增加了左右的外补丁<p> |