类选择器练习
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="类选择器练习.css">
<title>exercise1</title>
</head>
<body>
<div class=s1><img src="imgs/1.jpg"/></div>
<div class=s2><img src="imgs/2.jpg"/></div>
<div class=s3><img src="imgs/3.jpg"/></div>
</body>
</html>
css:
body
{
width:1000px;
height:800px;
margin: 0 auto;
border:5px solid green;
background-color:#999999;
}
.s1
{
margin-left:50px;
border:2px solid yellow;
margin-top:50px;
width:100px;
height:100px;
}
.s1 img
{
width:100px;
height:100px;
}
.s2
{
margin-left:50px;
border:2px solid yellow;
margin-top:50px;
width:100px;
height:100px;
}
.s2 img
{
width:100px;
height:100px;
}
.s3
{
margin-left:50px;
border:2px solid yellow;
margin-top:50px;
width:100px;
height:100px;
}
.s3 img
{
width:100px;
height:100px;
}