ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

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

2021-06-09 10:57:23  阅读:232  来源: 互联网

标签:ad color 代码 tp nth text1 child 美化版 文字广告


 

DEMO下载蓝奏云盘

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

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

 

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

 

暗黑模式

 

白天模式

 

 

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

<style type="text/css">
	.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;}
	.tp-ad-text1 a:nth-child(12n) {color:#ffb900;}
	.tp-ad-text1 a:nth-child(12n):hover {background:#ffb900;border-color: #ffb900;}
	.tp-ad-text1 a:nth-child(13n) {color:#fba78f;}
	.tp-ad-text1 a:nth-child(13n):hover {background:#fba78f;border-color: #fba78f;}
	.tp-ad-text1 a:nth-child(14n) {color:#f74e1e;}
	.tp-ad-text1 a:nth-child(14n):hover {background:#f74e1e;border-color: #f74e1e;}
	.tp-ad-text1 a:nth-child(15n) {color:#7fba00;}
	.tp-ad-text1 a:nth-child(15n):hover {background:#7fba00;border-color: #7fba00;}
	.tp-ad-text1 a:nth-child(16n) {color:#0fc317;}
	.tp-ad-text1 a:nth-child(16n):hover {background:#0fc317;border-color: #0fc317;}
	.tp-ad-text1 a:nth-child(17n) {color:#0517c2;}
	.tp-ad-text1 a:nth-child(17n):hover {background:#0517c2;border-color: #0517c2;}
	.tp-ad-text1 a:nth-child(18n) {color:#13cf8f;}
	.tp-ad-text1 a:nth-child(18n):hover {background:#13cf8f;border-color: #13cf8f;}
	.tp-ad-text1 a:nth-child(19n) {color:#ffb900;}
	.tp-ad-text1 a:nth-child(19n):hover {background:#ffb900;border-color: #ffb900;}
	.tp-ad-text1 a:nth-child(20n) {color:#f74e1e;}
	.tp-ad-text1 a:nth-child(20n):hover {background:#f74e1e;border-color: #f74e1e;}
	@media screen and (max-width: 1198px){
		.tp-ad-text1 a{
			width: 24%;
		}
	}
</style>
<div class="tp-ad-text1">
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="百变鹏仔" target="_blank">百变鹏仔</a>
    <a href="http://baidu.com/" title="QQ 344225443" target="_blank">QQ 344225443</a>
</div>

 

标签:ad,color,代码,tp,nth,text1,child,美化版,文字广告
来源: https://blog.51cto.com/u_14209124/2884225

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有