CSS实例:图片导航块

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>游戏中心</title>
    <link rel="stylesheet" type="text/css" href="../static/css/202.css">

</head>
<body>
<div>
    <div class="img">
           <a href="http://xyq.163.com/">
               <img src="http://p2.so.qhimgs1.com/bdr/_240_/t01f52549dbaa0009e2.jpg"></a>
           <div class="desc"><a href="http://xyq.163.com/">玩法说明</a></div>
    </div>
    <div class="img">
           <a href="http://xyq.163.com/">
               <img src="http://p2.so.qhimgs1.com/bdr/_240_/t01953c97e81ffda462.jpg"></a>
           <div class="desc"><a href="http://xyq.163.com/">攻略百科</a></div>
    </div>
        <div class="img">
           <a href="http://xyq.163.com/">
               <img src="http://p4.so.qhimgs1.com/bdr/_240_/t01929434685380e98a.jpg"></a>
           <div class="desc"><a href="http://xyq.163.com/">原声音乐</a></div>
    </div>
             <div class="img">
           <a href="http://xyq.163.com/">
               <img src="http://p0.so.qhimgs1.com/bdr/_240_/t01cc8b6adc9fb8ae70.jpg"></a>
           <div class="desc"><a href="http://xyq.163.com/">游戏素材</a></div>
    </div>
</div>
<div CLASS="clearfloat">
       <img src="http://p2.so.qhimgs1.com/bdr/_240_/t01f52549dbaa0009e2.jpg">
       <img src="http://p2.so.qhimgs1.com/bdr/_240_/t01953c97e81ffda462.jpg">
       <img src="http://p4.so.qhimgs1.com/bdr/_240_/t01929434685380e98a.jpg">
       <img src="http://p0.so.qhimgs1.com/bdr/_240_/t01cc8b6adc9fb8ae70.jpg">
</div>
</body>
</html>
img{
     width:300px;
}
div.img{
    border:1px; solid:#cccccc;
    width:180px;
    float:left;
    margin:5px;
}
div.img img{
    width:100%;
    height:auto;
}
div.desc{
    text-align:center;
    padding: 5px;
}
div.img:hover{
    border: 1px;solid:#777777;
}
.clearfloat{
    clear:both;
}

 

转载于:https://www.cnblogs.com/linf/p/7701620.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值