自适应网站图片广告横幅代码(带广告标识)

源码介绍

自适应网站图片广告横幅代码(带广告标识),单页HTML源码,源码行数比较少,可以放到自己的网站合适的位置,然后修改一下广告图片以及设置跳转链接即可

更多好看的HTML代码可以搜索QQ沐编程,觉得有帮助的话可以CTRL+D收藏一下本站

效果截图

图片[1]-自适应网站图片广告横幅代码(带广告标识)-QQ沐编程

源码如下

<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>横板自适应双广告图片</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #333;
        }

       .ad-container {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            justify-content: center;
        }

       .ad {
            position: relative;
            width: calc(50% - 10px);
            min-width: 300px;
            overflow: hidden;
        }

       .ad img {
            width: 100%;
            height: auto;
            display: block;
        }

       .ad-label {
            position: absolute;
            top: 10px;
            right: 10px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 5px 10px;
            border-radius: 3px;
            font-size: 12px;
        }

        @media (max-width: 768px) {
           .ad {
                width: 100%;
            }
        }
    </style>
</head>

<body>
    <div class="ad-container">
        <div class="ad">
            <img src="https://img-community.csdnimg.cn/bgimage/ef2ddfb086f24cc4a2642315f97fe50d.jpg" alt="广告1">
            <div class="ad-label">广告</div>
        </div>
        <div class="ad">
            <img src="https://img-community.csdnimg.cn/bgimage/ef2ddfb086f24cc4a2642315f97fe50d.jpg" alt="广告2">
            <div class="ad-label">广告</div>
        </div>
    </div>

 

© 版权声明
THE END
喜欢就支持一下吧
点赞13赞赏 分享