前端之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 }