我想问一下
我有一个全屏幕的脚本,位置固定但不完整
这是截图:
我的代码:
.affix{bottom:-1px; width: 100%; display:block; background-size: cover !important; position:fixed !important; z-index: 9999 !important;}

<div class="affix" style="background-color:#43A047; margin-top:-1px;">
<a href="http://myweb.com" target="_blank"><center><h3 style="color:#ffffff; padding:8px; margin:0px;"><i class="fa fa-pencil-square-o"></i> CLICKED...</h3></center></a>
</div>
&#13;
答案 0 :(得分:1)
尝试设置left:0
和width:100vw;
这是JSFiddle:https://jsfiddle.net/a1b5qoj0/5/
了解vw
: https://css-tricks.com/viewport-sized-typography/
.affix{
bottom:-1px;
width:100vw;
display:block;
background-size:
cover !important;
position:fixed !important;
z-index: 9999 !important;
left:0
}
<div class="affix" style="background-color:#43A047; margin-top:-1px;">
<a href="http://myweb.com" target="_blank">
<center>
<h3 style="color:#ffffff; padding:8px; margin:0px;">
<i class="fa fa-pencil-square-o">
</i> CLICKED...
</h3>
</center>
</a>
</div>
答案 1 :(得分:0)
您需要重置CSS:
* { padding: 0px; margin: 0px;}