css笔记11:选择器练习

1.

(1)exam1.css文件:

.s1 { font-size: 50px; color: blue;

} .s2 { backgoround:gray; font-style: italic; color: red;

} .s3 { background-color: gray;

}

(2)exam1.html文件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>exam1.html</title>

<link rel="stylesheet" type="text/css" href="./exam1.css"  />

</head>



<body>

   <font class="s1">梁山排行榜</font> <br/><br/>

   <span class="s2">宋江</span> <br/><br/>

   <span class="s3">卢员外</span> <br/><br/>

   

</body>

</html>

 

你可能感兴趣的:(css)