div 加关闭按钮
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了div 加关闭按钮相关的知识,希望对你有一定的参考价值。
给立即咨询后面加个关闭按钮 实现可以关闭了这个漂浮广告?
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5, user-scalable=0" />
<meta name="description" content="" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="format-detection" content="telphone=no" />
<title>全屏自适应始终漂浮手机网站底部广告js代码</title>
</head>
<body>
<!-- 登陆 -->
<style>
.margingT
margin-bottom: 80px;
.bottomAD
-webkit-box-sizing: border-box;
height: 80px;
position: fixed;
bottom: 0;
left: 0;
z-index: 1000;
padding: 0 10px;
overflow: hidden;
width: 100%;
background: rgba(0, 0, 0, .8);
.bottom-pic
position: absolute;
top: 10px;
width: 60px;
height: 60px;
overflow: hidden;
-webkit-border-radius: 10px;
border-radius: 10px;
.bottom-pic img
width: 100%;
height: 100%;
.bottom-text
margin-left: 70px;
line-height: 80px;
font-size: 32px;
color: #fff;
.bottom-btn
position: absolute;
top: 20px;
right: 100px;
height: 40px;
line-height: 40px;
color: #fff;
background-color: #60b900;
border-radius: 6px;
text-align: center;
font-size: 24px;
padding: 0 5px;
font-weight: bold;
.bottomAD a
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
</style>
<div class="bottomAD" id="bottomAD">
<div class="bottom-con">
<div class="bottom-pic">
<img src="http://lightapp.lanrenmb.com/Member//Public/upload/1/7/1/0/5453c0fc5545c.png" width="60" height="60" alt="" />
</div>
<div class="bottom-text" id="bottomText">懒人轻app - 所有场景应用一网打尽...</div>
<div class="bottom-btn">立即咨询</div>
</div>
<a id="bottomLink" href="http://www.lanrenmb.com/"></a>
</div>
</div>
</body>
</html>
<a id="bottomLink" href=""></a>下方加入关闭按钮
<div onclick='close2()' class="bottom-close">关闭</div>
函数
<script>
function close2()
document.getElementById('bottomAD').style.display='none';
</script>
样式
.bottom-close
position: absolute;
right:0;
top:0;
color: #fff;
本回答被提问者和网友采纳
以上是关于div 加关闭按钮的主要内容,如果未能解决你的问题,请参考以下文章