边框宽度 [英] Border Width

查看:63
本文介绍了边框宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述






以下div在IE和Opera中高达38像素,但在Firefox中为42像素
(显然它只计算边界的高度

宽度)


< div style =" background-color:#000000;身高:38px; border:2px

solid#FF0000;">< / div>


现在,我不知道哪一个是对的,但我会想知道

是否有解决方法。


谢谢,

亚历山大


Hi,

the following div is 38 pixels high in IE and Opera, however 42 pixels
in Firefox (apparently it calculates the height exclusively the border
width)

<div style="background-color: #000000; height: 38px; border: 2px
solid #FF0000;"></div>

Now, I dont know which of them is right, but I would like to know
whether there is a workaround.

Thanks,
Alexander

推荐答案

你有一个示例页面吗? div中是否有任何元素? Ist

有一个填充可能会改变高度吗?

也许div只是在Firefox中正确渲染而在另外两个中是错误的:
http://www.w3.org/TR/REC-CSS2/box。 html
http://www.positioniseverything .net / ... box-model.html


Chris

Alexander Mueller写道:
Du you have an example-page? Are there any elements within the div? Ist
there a padding wich might change the hight?
Maybe the div is just rendered right in Firefox and wrong in the two others:
http://www.w3.org/TR/REC-CSS2/box.html
http://www.positioniseverything.net/...box-model.html

Chris
Alexander Mueller wrote:



以下div在IE和Opera中高38像素,但在Firefox中有42像素(显然它只计算高度的边界宽度)

< div style =" background-color:#000000;身高:38px; border:2px solid
#FF0000;">< / div>

现在,我不知道哪一个是对的,但我想知道
是否有一个解决方法。

谢谢,
亚历山大

Hi,

the following div is 38 pixels high in IE and Opera, however 42 pixels
in Firefox (apparently it calculates the height exclusively the border
width)

<div style="background-color: #000000; height: 38px; border: 2px solid
#FF0000;"></div>

Now, I dont know which of them is right, but I would like to know
whether there is a workaround.

Thanks,
Alexander



Chris Leipold写道:
Chris Leipold wrote:
你有一个示例页面吗? div中是否有任何元素? Ist
有一个填充可能会改变高度?
也许div只是在Firefox中正确渲染而在两个其他人中错误:
http://www.w3.org/TR/REC-CSS2/box.html
http://www.positioniseverything.net/。 ..box-model.html
Du you have an example-page? Are there any elements within the div? Ist
there a padding wich might change the hight?
Maybe the div is just rendered right in Firefox and wrong in the two
others:
http://www.w3.org/TR/REC-CSS2/box.html
http://www.positioniseverything.net/...box-model.html




嗯,还有很多必要的例子。只需将代码放入

文件中,看看自己:)。正如我所提到的,我不知道谁是实际的

,但是想知道是否有解决方法。


谢谢,

Alexander



Well, there isnt much of an example necessary. Just drop the code into a
file and see yourself :). As I mentioned, I dont know who is actually
right, but would like to know whether there is a workaround.

Thanks,
Alexander


Alexander Mueller写道:


[IE中错误的盒子模型]
Alexander Mueller wrote:

[wrong box model in IE]
现在,我不知道哪一个是对的,但我想知道
是否有解决办法。
Now, I dont know which of them is right, but I would like to know
whether there is a workaround.




简答:是的。

更长的答案:搜索盒子型号。

-

Johannes Koch

In te domine speravi;非永久性的东西。

(Te Deum,4美分。)



Short answer: Yes.
Longer answer: Search for "box model".
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


这篇关于边框宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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