缤纷彩色文字广告代码,文字广告代码美化版,给网站添加文字广告教程

2022-05-26 0 1,584

PS

缤纷文字广告代码 文字广告代码美化版

运营的网站由于分类过多,于是想给网站添加一个类似文字广告的菜单分类引导,就在其他网上看到这种虚线边框划过变色文字广告样式,感觉还是很不错的,仿照写一份分享给大家吧!

或者有广告位需求的可以试下。

PC端时代码为8个文字块一行,H5为4个文字代码一行,所以大家添加文字广告为8、16、24…… 只要是8的倍数即可,当然推荐添加2行效果最好。

由于考虑到大家的网站有暗黑模式,所以在这方面也进行了简约的优化,适用于白天与晚上模式。

缤纷彩色文字广告代码,文字广告代码美化版,给网站添加文字广告教程

将CSS与HTML放置需要展示的地方即可,在修改对应的a标签的内容,跳转地址就OK了。

一行显示8个文字广告,文字内容不限制,超出会隐藏。

HTML代码

    <div class="tp-ad-text1">
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
        <a href="https://www.nianpo.com/" title="念破网" target="_blank">念破网</a>
    </div>

CSS代码

<style type="text/css">
	*{margin: 0;}
	body{padding: 50px 100px;box-sizing: border-box;}
	.tp-ad-text1 {width:100%;padding-top:6px;box-sizing:border-box;overflow: hidden;background: rgba(255,255,255,.2);}
	.tp-ad-text1 a {color:#7fba00;font-size:14px;line-height:38px;text-align:center;border:1px dashed rgba(0,0,0,.2);padding:0 3px;box-sizing:border-box;float:left;width:11.5%;height:38px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 0.5% 6px;text-decoration:none;transition:all .6s;}
	.tp-ad-text1 a:hover {font-weight: bold;color:#fff!important;background:#7fba00;transition: all .6s;}
	.tp-ad-text1 a:nth-child(2n) {color:#f74e1e;}
	.tp-ad-text1 a:nth-child(2n):hover {background:#f74e1e;border-color: #f74e1e;}
	.tp-ad-text1 a:nth-child(3n) {color:#00a4ef;}
	.tp-ad-text1 a:nth-child(3n):hover {background:#00a4ef;border-color: #00a4ef;}
	.tp-ad-text1 a:nth-child(4n) {color:#0517c2;}
	.tp-ad-text1 a:nth-child(4n):hover {background:#0517c2;border-color: #0517c2;}
	.tp-ad-text1 a:nth-child(5n) {color:#601165;}
	.tp-ad-text1 a:nth-child(5n):hover {background:#601165;border-color: #601165;}
	.tp-ad-text1 a:nth-child(6n) {color:#ffb900;}
	.tp-ad-text1 a:nth-child(6n):hover {background:#ffb900;border-color: #ffb900;}
	.tp-ad-text1 a:nth-child(7n) {color:#0fc317;}
	.tp-ad-text1 a:nth-child(7n):hover {background:#0fc317;border-color: #0fc317;}
	.tp-ad-text1 a:nth-child(8n) {color:#601165;}
	.tp-ad-text1 a:nth-child(8n):hover {background:#601165;border-color: #601165;}
	.tp-ad-text1 a:nth-child(9n) {color:#fba78f;}
	.tp-ad-text1 a:nth-child(9n):hover {background:#fba78f;border-color: #fba78f;}
	.tp-ad-text1 a:nth-child(10n) {color:#13cf8f;}
	.tp-ad-text1 a:nth-child(10n):hover {background:#13cf8f;border-color: #13cf8f;}
	.tp-ad-text1 a:nth-child(11n) {color:#f74e1e;}
	.tp-ad-text1 a:nth-child(11n):hover {background:#f74e1e;border-color: #f74e1e;}

声明:本站所有资源仅供学习和研究传播,大家请在下载后24小时内删除,一切关于该资源商业行为与念破网(https://www.nianpo.com)无关。 请勿将该资源进行商业交易、转载等行为,该资源只为研究、学习所提供,该软件使用后发生的一切问题与本站无关。 (若您进入本站就表示同意以上条款)若本资源侵犯了您的权益,请联系我们予以删除!(E-mail:765934@qq.com) 会员QQ群:5676140

念破网 WordPress教程 缤纷彩色文字广告代码,文字广告代码美化版,给网站添加文字广告教程 https://www.nianpo.com/303.html

常见问题

相关文章

官方客服团队

为您解决烦忧 - 24小时在线 专业服务