我有一个我一直想固定在页面顶部的 div,但它似乎不起作用.. 这是 div 代码本身
<div class="up-label">
<p><span>Testing 123.</span><br>
Blah BLah </p>
</div>
CSS
.up-label {
position: fixed;
top: 20px;
left: 20px
/*
width: auto;
margin:0 auto;
margin-top:-6px;
padding:10px; */
}
它似乎只是停留在它所在的位置,而不是固定在窗口中。