3
向上图像显示出来的黄色区域的不必要的红选择当您选择十字线。我要黄色部分中选择,如下所示:
HTML:
<div id="parent">
<div id="child">
This is some content... This is a long lonnnnnnng content.
</div>
</div>
CSS:
#parent {
width: 200px;
background-color: #666;
}
#child {
padding: 50px;
background-color: #ff0;
}
::selection {
background-color: #f00;
}
你知道如何实现这一目标?
运行代码在这里:http://jsfiddle.net/3AESf/
谢谢!这正是我想要的! – Ovilia
在高级中,您还可以将'padding:50px;'从'#child'移动到'#parent'。比你只在'小孩'容器内选择。 – insertusernamehere