前端之CSS樣式css
<p style="color: red">Hello world.</p>
<head> <meta charset="UTF-8"> <title>Title</title> <style> p {color: #0000cc} </style> </head>
head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="路徑"> </head>
/*找到全部title屬性以hello開頭的元素*/ [title^="hello"] { color: red; } /*找到全部title屬性以hello結尾的元素*/ [title$="hello"] { color: yellow; } /*找到全部title屬性中包含(字符串包含)hello的元素*/ [title*="hello"] { color: red; } /*找到全部title屬性(有多個值或值以空格分割)中有一個值爲hello的元素:*/ [title~="hello"] { color: green; }
a:link { color: #FF0000 }
a:visited { color: #00FF00 }
a:hover { color: #FF00FF }
a:active { color: #0000FF }
input:focus { outline: none; background-color: #eee; }
p:first-letter { font-size: 48px; color: red; }
p:before {content: "*"; color:red}
p:after {content: "#"; color:red}
p {color: yellow!important;}
body { font-family: "Microsoft Yahei", "微軟雅黑", "Arial", sans-serif } /*當系統不支持第一個,就會顯示第二個字體,依次,都沒有則顯示系統默認字體*/
a {text-decoration: none;}
background-position: right bottom; background-position: 200px 200px;
background:#ffffff url('1.png') no-repeat right top;
.c2 {border: 2px solid red;}
border-radius: 50%;
margin: 0 auto; /*順序爲順時針設置,上右下左,auto爲系統自動調節,*/ padding:5px 10px 15px 20px
提供一個,用於四邊;html
提供兩個,第一個用於上-下,第二個用於左-右;前端
若是提供三個,第一個用於上,第二個用於左-右,第三個用於下;瀏覽器
.clearfix:after { content: ''; display: block; clear:both }