我目前在选择文本时遇到问题。问题是,当我的父元素具有 display:flex 并且子元素具有 position:absolute 时,一旦单击父元素,Firefox就会选择该父元素内的所有文本。我发现可以通过添加
来解决此问题,但由于所使用的框架,我无法更改DOM。
在此示例中,您单击父元素(橙色)并选择了子元素内的所有文本。
#child {
width: auto;
position: absolute;
background: #00ff00;
}
#child2 {
width: auto;
left: 180px;
position: absolute;
background: #00ff00;
}
#parent {
display: flex;
width: 600px;
height: 400px;
background: #ff6600;
}
<div id="parent">
<div id="child">
<p>test first paragraph</p>
<p>test second paragraph</p>
<p>test third paragraph</p>
</div>
<div id="child2">
<p>test first paragraph</p>
<p>test second paragraph</p>
<p>test third paragraph</p>
</div>
</div>