我在创建弹出“关闭”文本按钮时遇到问题。弹出框有 CSS 属性:overflow:scroll 和 position:absolute。
JS小提琴:http: //jsfiddle.net/saifrahu28/qkfRr/
但我想将左上角的“CLOSE”文本移出<div>
. 这样,当滚动“关闭”文本时,显示保持在 div 的左上角。可能这可以通过在该 div 周围有一个 Wrapper Div 来完成,但他的主要问题是不能使用任何包装该 div 。这可能吗?
将 CLOSE 文本放在该 div 的左上角。
类的属性不能删除,但可以根据需要添加。如果需要任何 jquery 或 java 脚本没问题。但我被卡住了,我想找到一个结果。
任何帮助,将不胜感激 。
HTML
<div class="popup">
<p class="close">CLOSE</p>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled
it to make a type specimen book. It has survived not only five centuries,
but also the leapinto electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker
including versions of Lorem Ipsum.
</p>
</div>
CSS
.popup{
height:100px;
overflow:scroll;
width:400px;
background:#fafafa;
margin-top:50px;
position:absolute;
}
.close{
color:red;
}