自适应文字友链格子

资源共享 · 2024-04-29 11:17

想让你网站的友情链接更整洁好看吗?试试自适应文字友链格子!它能帮你轻松制作大小合适、排列有序的友情链接,让它们在任何设备上都显得完美。操作简单,效果显著,快来让你的友情链接更上一层楼吧!

效果展示

2024-04-29T03:15:07.png

代码

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<body>
        <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="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁1</a>
                <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁2</a>
                 <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁3</a>

<a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁4</a>
                <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁5</a>
                 <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁6</a>

<a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁7</a>
                <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁8</a>
                 <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁9</a>

<a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁10</a>
                <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁11</a>
                 <a href="https://yjvc.n" title="刘郎阁" target="_blank">刘郎阁12</a>

            </div>
</body>
</html>

写在最后

该代码也可以用于网站广告位展示。当然,具体情况具体分析,你也可以将它用到你需要的地方哦。

组件 优化 源码分享

上一篇 : 旋转小人

下一篇 : 一个不错的优惠劵聚合平台


  1. 书签网   访客
    2024-05-02 13:45 第11楼 中国福建省福州市中移铁通Windows 10 · Google Chrome

    非常不错,拿走了

  2. 三毛笔记   访客
    2024-04-30 10:32 第9楼 中国福建省厦门市电信Windows 10 · Google Chrome

    怎么添加到友链页?

    1. 刘郎   博主
      2024-04-30 10:35 第10楼 中国移动iPhone · Safari
      @三毛笔记

      在 page-links.php (或者你自己的友链)文件中添加即可

  3. Net   Lv1
    2024-04-29 21:01 第7楼 中国河北省邢台市电信iPhone · Safari

    如果这样我看做成一个单页也是可以的,也是蛮简洁的。

    1. 刘郎   博主
      2024-04-30 08:04 第8楼 中国贵州省移动iPhone · Safari
      @Net

      是个不错的想法👍

  4. obaby   Lv1
    2024-04-29 15:00 第3楼 中国山东省青岛市联通iPhone · Google Chrome

    五颜六色,真不错

    1. 刘郎   博主
      2024-04-29 15:02 第5楼 中国贵州省移动Windows 10 · QQ Browser
      @obaby

      呃这。。哈哈,欢迎姐大😂

    2. obaby   Lv1
      2024-04-29 15:01 第4楼 中国山东省青岛市联通iPhone · Google Chrome
      @obaby

      怎么还能给我识别成 iPhone,离谱啊,我是 mac

      1. 刘郎   博主
        2024-04-29 15:06 第6楼 中国贵州省移动Windows 10 · QQ Browser
        @obaby

        是有点离谱,不充钱的就将就用啦😲

  5. 老罗   Lv1
    2024-04-29 14:47 第1个脚印 中国广东省深圳市联通Android · Google Chrome

    板式漂亮,可做友联,可做导航,似乎很眼熟啊😄

    1. 刘郎   博主
      2024-04-29 14:52 第2楼 中国贵州省移动Windows 10 · QQ Browser
      @老罗

      熟悉就对啦,好东西要共享😎

| 黔ICP备2024020400号-1 | 萌ICP备20246777号 | | 当前有 1 人在线 |
本站已加入BLOGS·CN
yjvc.cn
博友圈 星球穿梭
开往-友链接力