精灵图:
html代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../css/财神.css"/>
</head>
<body>
<div class="box">
<div class="box1">
<span class="s1"></span>
<div class="box2">
您尚未登录<br />
登录可关注更过信息
</div>
</div>
<div class="box3">
<table border="0" rules="0" cellspacing="10px" cellpadding="0">
<tr style="height: 35px;">
<td align="right" width="135px">
<input class="in1" type="button" value="登 录" />
</td>
<td width="135px">
<input class="in2" type="button" value="注 册" />
</td>
</tr>
</table>
</div>
<div class="box4">
<span class="s2"></span>
QQ登录
<span class="s3"></span>
微信登录
<span class="s4"></span>
微博登录
</div>
</div>
</body>
</html>
css样式:
.box{
width: 270px;
height: 180px;
background-color: #f7f7f7;
margin: auto;
}
.box1{
height:80px;
}
.box2{
width: 175px;
margin-top: 25px;
font-size: 15px;
float: right;
letter-spacing: 1px;
}
.s1{
display: inline-block;
width: 67px;
height: 67px;
background: url(../img/财神.png) no-repeat;
margin-left: 18px;
margin-top: 13px;
float: left;
}
.box4{
margin-top: 5px;
font-size: 13px;
color: #003398;
}
.s2{
display: inline-block;
width: 12px;
height: 14px;
background: url(../img/sprite.png) no-repeat; /* 引入图片,并设置平铺不重复*/
background-position:-468px -308px ; /* 以精灵图的左上角坐标原点,右边为X轴
的正方向,下边为Y轴的正方向,通过调节
X,Y值来实现图片的呈现*/
margin-left: 20px;
vertical-align: bottom;
}
.s3{
display: inline-block;
width: 17px;
height: 14px;
background: url(../img/sprite.png) no-repeat;
background-position:-649px -162px ;
margin-left: 5px;
vertical-align: bottom;
}
.s4{
display: inline-block;
width: 17px;
height: 15px;
background: url(../img/sprite.png) no-repeat;
background-position:-671px -162px ;
margin-left: 5px;
vertical-align: bottom;
}
.in1{
width: 110px;
height:35px;
background-color: #ea5404;
border: none;
font-size: 15px;
color: #ffffff;
}
.in2{
width: 110px;
height:35px;
background-color: #ffffff;
border-color: #1a92fd;
font-size: 15px;
color: #44a5fc;
效果图: