CSS ??
CSS ??
CSS ??? ? ?? ?? ??, ? ???? ?? ??? ???? ?????.
???? ????? HTML? ???? ? ??? ??????. ??.
? ??? ??? ??? ?????.
??? ????? ??? ?????. ? ???? ?? ????. ??? ?? ???? ?????.
CSS ??
CSS ??? ?? ????(;)?? ??? ?? ??? ???({}):
p {color:red ;text -align:center;}
CSS? ? ?? ?? ??? ?? ? ?? ??? ??? ??? ? ????:
?
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <style> p { color: #ff122b; text-align:center; } </style> </head> <body> <p>Hello World!</p> <p>這一段是用CSS樣式化。</p> </body> </html>
? CSS ????
??? ??? ??? ?? ?????. #ff122b, ???? ??? ????.
????? ???? ??? ???.
CSS ??
??? ??? ???? ? ???? ???? ??? ? ??? ????? ?? ?????.
CSS ??? "/*"? ???? "*/"? ????. ?? ??? ????:
/*??? ?????*/
p
{
text-align:center;
/*??? ? ?? ?? */
color:black;
font-family:arial;
}
?? ? ??
Instance 1
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <style> body {background-color:#8cd6ff;} h1 {font-size:36px;} h2 {color:blue;} p {margin-left:50px;} </style> </head> <body> <h1>這個(gè)頭是36 pt</h1> <h2>這個(gè)頭是藍(lán)色的</h2> <p>這一段有一個(gè)50像素的左邊框</p> </body> </html>
????? ???? ??? ???
Instance 2
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> body {background-color:tan;} h1 {color:maroon;font-size:20pt;} hr {color:navy;} p {font-size:11pt;margin-left:15px;} a:link {color:green;} a:visited {color:yellow;} a:hover {color:black;} a:active {color:blue;} </style> </head> <body> <h1>這是一個(gè)標(biāo)題</h1> <hr> <p>您可以看到鏈接格式文本</p> <p><a href="http://php.cn" target="_blank">鏈接</a></p> </body> </html>
????? ???? ??? ???