每当我在我的网站上选择/突出显示文本时,该栏会覆盖我页面上的所有内容。
(文本选择框实际上不是灰色的,只是需要截图)我怎样才能阻止它这样做,让它留在白色框中?
文本所在的白框使用“word-wrap: break-word”来阻止文本与白框重叠。不知道是不是这个问题。
<p> Test Test Test Test Test </p>
p {
font-family: "Calibri";
font-style: normal;
font-variant: normal;
font-size: 18px;
color: black; }
谢谢
最佳答案
只需为子 div 添加样式 oveflow: hidden;
。
找到下面的例子
HTML
<div class="wrap">
<div class="content">
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
</div>
</div>
CSS
.wrap{
background: #ddd;
overflow: hidden;
padding: 20px;
}
.content{
width: 50%;
margin: 0 auto;
background: #fff;
overflow: hidden;
}
关于html - 文本选择覆盖整个屏幕宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27950902/