简体   繁体   English

Google Chrome的CSS对齐问题

[英]CSS Alignment problem with Google Chrome

I have a little alignment problem with my table. 我的桌子有点对齐问题。 This only occurs with Google Chrome. 这仅在Google Chrome浏览器中发生。 I would like to have my header checkbox aligned with all checkbox of my table. 我想使标题复选框与表格的所有复选框对齐。 Everything works well on IE & Chrome until I add the css table-layout:fixed; 在我添加css table-layout:fixed;之前,一切在IE和Chrome上都能正常运行 . You can see the result below. 您可以在下面看到结果。 On Chrome, the header checkbox is no more aligned with all other checkbox in my table. 在Chrome上,标题复选框不再与表格中的所有其他复选框对齐。

Internet Explorer显示的页面使用Google Chrome浏览器显示的页面

Here is my css: 这是我的CSS:

table.search-results
{
  border-collapse: collapse;  
  table-layout:fixed;
  width: 100%;
}

table.search-results td.tipsy-empty { width: 5px;  }
table.search-results td.tipsy       { width: 5px;  }
table.search-results td.checkbox    { width:20px;  }
table.search-results td.favoricon   { width:20px;  }
table.search-results td.idaffaire   { width:50px;  }
table.search-results td.information { width:auto; white-space:nowrap; overflow:hidden; }
table.search-results td.username    { width:50px;  }

Any help is greatly appreciated. 任何帮助是极大的赞赏。

Use a CSS reset: http://developer.yahoo.com/yui/reset/ 使用CSS重置: http//developer.yahoo.com/yui/reset/

It looks like the browsers have different default CSS settings for those elements. 看来浏览器对这些元素具有不同的默认CSS设置。 Always use a CSS reset, don't let browsers control you :) 始终使用CSS重置,不要让浏览器控制您:)

If you're using Webkit rounded corners, it could also be the problem. 如果您使用的是Webkit圆角,也可能是问题所在。 Notice how the colored labels also are pushed out. 注意如何将彩色标签推出。 IE doesn't support these rounded corners, which is why they appear as they should. IE不支持这些圆角,这就是为什么它们应有的外观。 Check Safari, I bet that's your issue. 检查Safari,我敢打赌这是您的问题。 Find a non-css method of rounded corners. 查找圆角的非css方法。 They can be a bit ugly, but they prevent things like this. 它们可能有点丑陋,但可以防止此类情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM