Javascript 某个特定类应显示Through<;部门>;has-oveflow:隐藏属性

Javascript 某个特定类应显示Through<;部门>;has-oveflow:隐藏属性,javascript,jquery,css,Javascript,Jquery,Css,我在创建弹出“关闭”文本按钮时遇到问题。弹出框具有CSS属性: 溢出:滚动和位置:绝对 JS小提琴: 但是我想移动左上方的“关闭”文本。这样,当滚动“CLOSE”(关闭)文本时,显示内容保持在div的左上方。可能这可以通过在该Div周围使用包装Div来实现,但主要问题是不能使用该Div的任何包装。这可能吗 将结束文本放在该div外的左上角 类的属性不能被删除,但可以在必要时添加。如果需要任何jquery或java脚本,没有问题。但我被困住了,我想要一个结果 任何帮助都将不胜感激 HTML <

我在创建弹出“关闭”文本按钮时遇到问题。弹出框具有CSS属性: 溢出:滚动和位置:绝对

JS小提琴:

但是我想移动
左上方的“关闭”文本。这样,当滚动“CLOSE”(关闭)文本时,显示内容保持在div的左上方。可能这可以通过在该Div周围使用包装Div来实现,但主要问题是不能使用该Div的任何包装。这可能吗

将结束文本放在该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,只隐藏内容溢出:


如何重新组织css,只隐藏内容溢出:


您可以使用
position:fixed执行此操作

演示


您可以使用
position:fixed执行此操作

演示


你的意思是这样的?你的意思是这样的?实际上,你的解决方案帮助我了解了这个想法。谢谢,我知道它的位置了。:)实际上,你的解决方案帮助我了解了这个想法。谢谢,我知道它的位置了。:)
.popup{
height:100px;
overflow:scroll;
width:400px;
background:#fafafa;
margin-top:50px;
position:absolute;
}
.close{
  color:red;
}
.popup{
    position:absolute;
}
.popup .content {
    height:100px;
    overflow:scroll;
    width:400px;
    background:#fafafa;
    margin-top:50px;
}
.close{
   color:red;
    position:fixed;
    z-index:1000;
    top:10px;
    left: 0;
}