h1 {color:red; font-size:14px;}
元素選擇器h1,h2,h3,h4,h5,h6 {color: green;}
選擇器分組li strong {font-style: italic;font-weight: normal;}
//派生選擇器#idStr {color:red;}
//id選擇器.className {text-align: center}
//類選擇器[title=W3School] { border:5px solid blue; }
// 屬性選擇器<link rel="stylesheet" type="text/css" href="mystyle.css" />
//外部樣式css
內部樣式url
<style type="text/css"> hr {color: sienna;} p {margin-left: 20px;} body {background-image: url("images/back40.gif");} </style>
內聯樣式spa
<p style="color: sienna; margin-left: 20px"> This is a paragraph </p>
結合使用時,就近原則!!code
Positioningorm
display繼承