Firefox和Chrome之间的1个像素线的高度差 [英] 1 pixel line height difference between Firefox and Chrome

查看:202
本文介绍了Firefox和Chrome之间的1个像素线的高度差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个新的网站设计asp.net母版页的工作。页面的标题是35px高菜单栏,其中包含呈现为无序列表的ASP菜单控制。

Working on a new site design in asp.net with master pages. Header of the page is a 35px tall "menu bar" which contains an asp menu control rendered as an unordered list.

所选菜单项的样式与differenct彩色背景和2px的边界周围的左顶和右两侧。选定菜单项的底部应排队与菜单栏的底部,所以选择标签看起来好像流入内容下方。看起来Firefox和IE,但在Chrome的标签精似乎是1比像素菜单栏的底部高。

The selected menu item is styled with a differenct colored background and 2px border around the left top and right sides. The bottom of the selected menu item should line up with the bottom of the menu bar so the selected "tab" looks as if it flows into the content beneath. Looks fine in firefox and IE but in chrome the "tab" seems to be 1 pixel higher than the bottom of the menu bar.

只是想知道是否有某种类型的错误我不知道。

Just wondering if there is some sort of bug I dont know about.

我知道你很可能需要code,以尽快帮助解决这个问题,所以生病后了CSS。

I realize that you will most likely need code to help with this problem so ill post up the css as soon as possible.

编辑:

下面是CSS的菜单...

here is the css for the menu...

div.hideSkiplink
{     
    width:40%;
    float:right;
    height:35px;
}

div.menu
{
    padding: 0px 0px 0px 0px;
    display:inline;
}

div.menu ul
{
    list-style: none;
}

div.menu ul li
{
    margin:0px 4px 0px 0px;
}

div.menu ul li a, div.menu ul li a:visited
{
  color: #ffffff;
  display: block;
  margin-top:0px;
  line-height: 17px;
  padding: 1px 20px;
  text-decoration: none;
  white-space: nowrap;
}

div.menu ul li a:hover
{
  color: #ffffff;
  text-decoration: none;
  border-top: 1px solid #fff;
  border-right: 1px solid #fff;
  border-bottom: none;
  border-left: 1px solid #fff;
}




div.menu ul li a:active
{
 background:#ffffff !important;
 border-top:2px solid #a10000;
 border-right:2px solid #a10000;
 border-bottom: none;
 border-left:2px solid #a10000;
 color: #000000 !important;
 font-weight:bold;

}


div.menu ul a.selected
{
  color: #000000 !important;
  font-weight:bold;
}

div.menu ul li.selected
{
 background:#ffffff !important;
 border-top:2px solid #a10000;
 border-right:2px solid #a10000;
 border-bottom: none;
 border-left:2px solid #a10000;
}

div.menu ul li.selected a:hover
{
  border: none;
}

选定的类被添加到利和通过的jquery ...

The selected classes are added to the li and a elements via jquery...

这是问题的截图...
铬的例子是在顶部和u可以看到选项卡下方的红色边框1px的。
在底部是Firefox的形象,一切看起来不错。

Here is a screenshot of the problem... The chrome example is on the top and u can see 1px of red border below the tab. On the bottom is the firefox image where everything looks OK.

编辑:

这个玩弄多一点之后,我发现,它实际上是头分区本身是由镀铬1px的成长......这似乎很奇怪,我。

After playing around with this a bit more, I have discovered that it is actually the "header" div itself that is growing by 1px in chrome... This seems very strange to me.

推荐答案

要认识到,网页总是在不同的浏览器呈现不同的是很重要的。 Acheiving像素完美是徒劳的,而且目前我试图给我的客户解释什么样的成本是参与,使每一个浏览器渲染的网站一模一样。更多的时候,现在,他们明白,IE6和FF4永远不会呈现任何页面的方式相同。我们必须设法使我们的客户了解和接受网络的动态。

It's important to realize that web pages will always render differently in different browsers. Acheiving pixel perfection is futile, and nowadays I try to explain to my clients what kind of cost is involved to make every browser render the site exactly alike. More often now, they understand that IE6 and FF4 won't ever render any page the same way. We must try to make our clients understand and embrace the dynamics of the web.

渐进增强和优雅降级。和平。

Progressive enhancement and graceful degradation. Peace.

这篇关于Firefox和Chrome之间的1个像素线的高度差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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