【css】選擇器
阿新 • • 發佈:2017-09-26
通配符選擇器
標簽、通配符選擇器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>標簽選擇器</title> <style type="text/css"> <!-- body:標簽選擇器 *:通配符選擇器 .:類選擇器 CSS屬性: Text-align Center,left,right 文字居中格式 Font-size 18px 設置文字大小 Font-family 微軟雅黑,宋體 設置字體 Font-weight Normal默認,bold粗體,100px 設置字體加粗 Font-style Normal默認,italic斜體 設置字體風格 Color 顏色 設置文字顏色 --> body{ background:url("xia.jpg"); } div{ font-size:50px; color:green; background-color:blue; width:300px; height:200px; } *{ font-size: 100px; color: red; } </style> </head> <body> <h1>111</h1> <div>14期威武</div> </body> </html>
類選擇器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .G{ font-size: 200px; color:red; } .o1{ font-size: 200px; color: blue; } .o2{ font-size: 200px; color: yellow; } .g1{ font-size: 200px; color: green; } .l{ font-size: 200px; color: pink; } .e{ font-size: 200px; color: black; } </style> </head> <body> <span class="G">G</span> <span class="o1">o</span> <span class="o2">o</span> <span class="g1">g</span> <span class="l">l</span> <span class="e">e</span> </body> </html>
【css】選擇器