Firefox / IE中的UL和LI [英] UL and LI in Firefox/IE

查看:76
本文介绍了Firefox / IE中的UL和LI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个无序列表的CSS。


ul

{

padding:0px;

保证金:0px;


list-style:none;

padding-top:50px;

}


li

{

填充:0px;

保证金:0px;

行高:38px;

}


所以这个想法非常简单。我将列表填入50px顶部以将其移动到它的'div $ div'中。然后我列出菜单并将每个li

设置为38px行高。行高将文本置于IE中的

背景图像中。但是,在firefox中,li元素的高度

比IE中的大,暗示行高被解释为

不同。

就好像在IE浏览器中,每个LI的完美度为38px,而在Firefox中则为
39px。考虑到填充和

边距设置为0,并且行高设置为38px,我不知道这是怎么回事。

解决方案

ck******@gmail.com 写道:


>

就好像在IE浏览器中,每个LI完全是38px,在Firefox中它是'这是

39px。



Gee,真是个灾难。 :-\


如果你在一个列表项中挂了1个像素,我可以想象

其余的布局是什么喜欢。这不是好事。 :(


-

Berg


Scripsit ck ****** @ gmail.com


我有以下CSS无序列表。



URL如何?


我将列表填入50px顶部以移动它

在它的内部div。



为什么?无论如何,这似乎与<中的任何其他内容无关br />
问题。


然后我列出菜单并将每个li

设置为38px行高。



为什么?你有没有考虑过有些人_have_将
字体大小设置为60px以便能够读取的可能性文本?另外,

设置行高是错误的想法。谁知道某些项目是否会在某一天实际上分布在两行中的
,以及如何illy会的东西_then_

看起来像?


行高将文本置于

背景图片中心在IE中。



什么背景图片?无论如何,这是一个愚蠢的想法,因为线高不是为这样的目的而设计的,并且需要_not_意味着等于上面的间距和

以下。
< blockquote class =post_quotes>
但是,在firefox中,li元素的高度

大于IE中暗示行高被解释为

不同。



我们应该感到惊讶吗?


就好像在IE中一样,它是完美的每个38px,在Firefox中,它是b
39px。考虑到填充和

边距设置为0,并且行高设置为38px,我不知道这是怎么回事。



如果您的问题确实是一台浏览器上的38px和另一台浏览器上的
39px之间的区别,那么您显然不知道您的问题是什么真正的问题

是。我们也没有,因为你没有透露网址。


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/


3月19日下午12:37,Bergamot< berga ... @ visi.comwrote:


ckarb ... @ gmail.com写道:


就好像在IE浏览器中,每个LI完全是38px,在Firefox中,它是
39px。



Gee,真是个灾难。 :-\


如果你在一个列表项中挂了1个像素,我可以想象

其余的布局是什么喜欢。这不是好事。 :(


-

Berg



嗯,称之为灾难不是''我有一个平面设计师给我的布局

。它超过1 px,它是1px off

每个列表将多个菜单项加起来的项目。我正在尝试使用CSS以正确方式执行此操作




我''我正在寻求建议或建设性的批评,而不是这是一场灾难。我还在学习。提前致谢。


I have the following CSS for an unordered list.

ul
{
padding:0px;
margin:0px;

list-style: none;
padding-top: 50px;
}

li
{
padding:0px;
margin:0px;
line-height: 38px;
}

So the idea is pretty simple. I pad the list by 50px top to move it
down within it''s contaning div. I then list the menu and set each li
to 38px line-height. The line-height centers the text within a
background image in IE. However, in firefox, the li element''s height
is larger than in IE implying that the line-height is interpreted
differently.

It''s as if in IE it''s perfectly 38px per LI, and in Firefox it''s
39px. I don''t see how this could be the case given that padding and
margin are set to 0, and the line-height is set to 38px.

解决方案

ck******@gmail.com wrote:

>
It''s as if in IE it''s perfectly 38px per LI, and in Firefox it''s
39px.

Gee, what a disaster. :-\

If you''re so hung up on 1 pixel in a list item, I can imagine what the
rest of the layout is like. And it isn''t good. :(

--
Berg


Scripsit ck******@gmail.com:

I have the following CSS for an unordered list.

How about a URL?

I pad the list by 50px top to move it
down within it''s contaning div.

Why? Anyway, this seems to have nothing to do with anything else in the
question.

I then list the menu and set each li
to 38px line-height.

Why? Did you even consider the possibility that some people _have_ to set
font size to, say, 60px in order to be able to read the text? Besides,
setting line-height is a wrong idea here. Who knows whether some items will
some day actually spread across two lines, and how silly will things _then_
look like?

The line-height centers the text within a
background image in IE.

What background image? Anyway, it''s a silly idea, since line-height was not
designed for such purposes and need _not_ mean equal spacing above and
below.

However, in firefox, the li element''s height
is larger than in IE implying that the line-height is interpreted
differently.

Should we be surprised?

It''s as if in IE it''s perfectly 38px per LI, and in Firefox it''s
39px. I don''t see how this could be the case given that padding and
margin are set to 0, and the line-height is set to 38px.

If your problem is really the difference between 38px on one browser and
39px on another, then you clearly have no idea of what your real problems
are. Neither have us, since you didn''t reveal a URL.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


On Mar 19, 12:37 pm, Bergamot <berga...@visi.comwrote:

ckarb...@gmail.com wrote:

It''s as if in IE it''s perfectly 38px per LI, and in Firefox it''s
39px.


Gee, what a disaster. :-\

If you''re so hung up on 1 pixel in a list item, I can imagine what the
rest of the layout is like. And it isn''t good. :(

--
Berg

Well, calling it a disaster isn''t going to help. I have a layout
given to me by a graphic designer. It''s more than 1 px, it''s 1px off
per list item which adds up over several menu items. I''m trying to
do this the "right" way by using CSS.

I''m looking for advice or constructive criticism, not "this is a
disaster." I''m still learning. Thanks in advance.


这篇关于Firefox / IE中的UL和LI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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