全球VPS大学 大佬有话说 : 2019-12-17 20:32:59
帮忙看看我这个代码怎么改。
本帖最后由 全球VPS大学 于 2019-12-17 22:22 编辑
对大侠来说很简单,我小白还在学习。
CSS和html
然后我运行代码后,点击X,关不掉,这是什么问题。大侠帮忙找一下问题。
html{height: 100%;}
body{margin: 0; background:#fff; font-family:Helvetica,Arial,PingFangSC-Regular,Microsoft Yahei,sans-serif; font-size:0.35rem; line-height: 140%; color: #666;-webkit-text-size-adjust: none;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
ul,li{margin:0; padding:0; list-style:none;}
.fodong_box{display: block; padding: 0 0.5rem; background: rgba(0,0,0,0.3); color: #fff; position: absolute; top: 0; z-index: 9999; width: 100%;}
.fodong_tips{float: left; overflow: hidden; margin: 0 auto; width: 100%; height: 1.2rem; line-height: 1.2rem;}
.mytip {background: #ff1500;padding: 0.05rem 0.1rem;margin-right: 0.1rem;border-radius: 2px;}
.close_tips{float: right; color: #fff; font-size: 0.325rem; line-height: 0.9rem;margin-right: 10px;}
这是CSS 的
<div id="fd_tips" class="fodong_box">
<div id="mq" class="fodong_tips">
<a class="close_tips" onclick="mq" href="javascript:void(0)">X</a>
<ul style="margin-top: 0px;">
<li>小小的公告一枚。</li>
</ul>
</div>
</div>
robot 大佬有话说 : 2019-12-17 20:43:54
onclick="mq"
js代码呢:lol
朕的大清完了? 大佬有话说 : 2019-12-17 21:08:46
关不掉要js操作。
全球VPS大学 大佬有话说 : 2019-12-17 21:17:59
本帖最后由 全球VPS大学 于 2019-12-17 22:18 编辑
robot 大佬有话说 : 2019-12-17 20:43
onclick="mq"
js代码呢
robot 大佬有话说 : 2019-12-17 22:12:22
把onclick="mq" 改成 onclick="mq()"
然后把这个加进html
<script type="text/javascript">
function mq(){
document.getElementById("fd_tips").style.display="none";
}
</script>
全球VPS大学 大佬有话说 : 2019-12-17 22:18:36
robot 大佬有话说 : 2019-12-17 22:12
把onclick="mq" 改成 onclick="mq()"
然后把这个加进html
谢谢大侠,OK了,比吾爱悬赏好多了,还是loc 牛X啊
art 大佬有话说 : 2019-12-17 22:22:55
nice
titanic 大佬有话说 : 2019-12-17 22:23:45
这里都是全球顶尖技术的大佬,能不厉害吗
蓝洛水深 大佬有话说 : 2019-12-17 22:42:38
全球VPS大学 大佬有话说 : 2019-12-17 22:18
谢谢大侠,OK了,比吾爱悬赏好多了,还是loc 牛X啊
赶上好政策了,以前一样要悬赏