CSS文本选择颜色在框外溢出 [英] CSS text selection color overflows outside box

查看:59
本文介绍了CSS文本选择颜色在框外溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是CSS的新手,想知道是否有任何方法可以阻止文本选择颜色进入装订线"(我认为这是术语?),如下所示:

I'm new to CSS and was wondering if there was any way to stop the text selection color going into the 'gutter' (I think that's the term?) like here:

我知道这很琐碎,但是我注意到在列之间使用空格的专业(在线)网站都没有这个问题.

I know it's something pretty trivial but I've noticed that none of the professional (online) websites that use a gap between columns have this problem.

如果您浮动该列,则不会遇到此问题.

If you float the column, it doesn't experience this issue.

所以一种解决方案似乎是在两列上都浮动,但是我剩下的问题是在列和页脚之间留出间隙(我必须指定页边距的上限(标头),我想要它,但它不是很动态).

So one solution seems to be floating both columns, but then I'm left with the issue of making a gap between the columns and the footer (I'd have to specify how much margin-top (no. of pixels from the header) I want for it, which isn't very dynamic).

有人有什么想法吗?

这是当前的CSS代码:

Here is the current CSS code for it:

.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;
}

推荐答案

尝试一下:

#panel2
{
background-color:brown;
width:400px;
overflow: hidden;
}

应该这样做.

这篇关于CSS文本选择颜色在框外溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆