好看的网站自适应图片文字广告位代码

144次阅读
没有评论

好看的网站自适应图片文字广告位代码

上边是图片广告位,下边是文字广告位,适用于所有网站。

发现了一些问题进行了修复,修复内容:图片广告位如果图片小显示会异常,文字存在下划线。

一个好的广告位不仅不会拉低网站的颜值,还会增加广告主选择你的机会。

广告位代码适配一下自己的网站效果会更好哦。

<div class="ad">
<!-- 图片横幅广告 -->
<a href="https://www.xgw5.com" target="_blank" ><img src="https://y.gtimg.cn/music/photo_new/T053M000003UUUus1HuyfW.gif" width="100%"></a>
<!-- 自适应文字广告 -->
<li><a href="https://www.xgw5.com" target="_blank" style="line-height:60px;height:60px;color:#fff;background:#01AAED;text-align:center;font-size:24px;"> 广告招商 虚位以待 </a></li>
<li> <a href="https://www.xgw5.com"  target="_blank" style="line-height:60px; height:60px ;color:#fff; background:#2F4056; text-align:center; font-size:24px;" > 广告招商 虚位以待 </a></li>
</div>

<div class="txtguanggao">
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>
<a href="https://www.xgw5.com" target="_blank" class="dh"> 超低价文字广告位 </a>

</div>
<style>
/** 广告位 **/
.ad{background:#fff;overflow:hidden;clear:both;border-radius: 6px;}
.ad a{margin:5px;display:block;border-radius:3px;}
.ad img{max-width:100%;}
.ad li{float:left;width:50%;list-style:none;}
@media(max-width:999px) {.ad{margin: 0 0 10px 0;}
.ad li{width:100%;}
}
/** 新增文字广告 **/
.txtguanggao{
    width: 100%;
    overflow: hidden;
    display: block;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
}
.txtguanggao a{width: calc((100% - 20px) / 4);
    float: left;
    border-radius: 2px;
    line-height: 35.35px;
    height: 35.35px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    display: inline-block;
    background-color: rgb(255, 153, 159);
    margin: 2.5px;
    
    transition-duration: .3s;
}
.txtguanggao a:nth-child(1) {background-color: #dc3545;}
.txtguanggao a:nth-child(2) {background-color: #007bff;}
.txtguanggao a:nth-child(3) {background-color: #28a745;}
.txtguanggao a:nth-child(4) {background-color: #ffc107;}
.txtguanggao a:nth-child(5) {background-color: #28a745;}
.txtguanggao a:nth-child(6) {background-color: #ffc107;}
a {text-decoration: none;}
.txtguanggao a:nth-child(7) {background-color: #dc3545;}
.txtguanggao a:nth-child(8){background-color: #007bff;}
.txtguanggao a:hover{background:#FF2805;color:#FFF}
@media screen and (max-width: 1000px) {
.txtguanggao a{width: calc((100% - 10px) / 2);
    float: left;
    border-radius: 2px;
    line-height: 35.35px;
    height: 35.35px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    display: inline-block;
    background-color: rgb(255, 153, 159);
    margin: 2.5px;
    transition-duration: .3s;
}
}
  @media screen and (min-width: 1000px) {
    .txtguanggao a{width: calc((100% - 20px) / 4);
    }}
</style>

正文完
 0
老马
版权声明:本站原创文章,由 老马 于2024-02-25发表,共计2663字。
转载说明:本站提供的一切软件、教程、电子书、视频、图片、音乐、文字以及所有内容信息仅供个人学习、研究或欣赏;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网友分享及网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。如果您喜欢相关内容信息,请支持正版,进行购买注册,以得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!侵删请致信E-mail:tntwl@qq.com
评论(没有评论)