基本上,当我在某些网站上使用谷歌浏览器并突出显示文本时,突出显示跨越浏览器的整个宽度而不是仅突出显示文本.如何调整CSS以使其在突出显示文本时,它只突出显示单词而不是跨越整个页面.一个很好的例子是http://guides.rubyonrails.org/getting_started.html.尝试在Google Chrome中突出显示非代码文字,您可以看到我在说什么.
我是CSS的新手,并且想知道是否有任何方法可以阻止文本选择颜色进入"排水沟"(我认为这是术语?),就像这里:

我知道这是非常微不足道的事情,但我注意到,使用列之间存在差距的专业(在线)网站都没有这个问题.
如果您浮动列,则不会遇到此问题.
因此,一个解决方案似乎是浮动两列,但后来我留下了在列和页脚之间产生间隙的问题(我必须指定多少margin-top(标题中的像素数)我想要它,这不是很动态).
有没有人有任何想法?
这是当前的CSS代码:
.box /*this is applied to all the divs*/
{
border: 1px black dotted;
padding:3px;
}
body
{
width: 850px;
margin: 0 auto;
}
#panel0
{
background-color: blue;
}
#panel1
{
background-color:red;
width: 400px;
float:right;
}
#panel2
{
background-color:brown;
width:400px;
}
#panel3
{
background-color:yellow;
clear: right;
}
Run Code Online (Sandbox Code Playgroud)