开发者

Strange Chrome behavior: calculates all margin percentages right except for margin-top!

When I declare this style for a div:

#fbInner{
    position: absolute;
    margin: 11.2% 9.7% 0% 26.4%;
    width: 63.5%;
    height: 54.6%;
    overflow: visible;
    /*max-height: 190px;
    max-width: 490px;*/
    font-size: 11px;
    font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
    color: #FFF;
    /*border开发者_Go百科: solid 2px gray;*/
}

Chrome sets every margin right except of the margin top, which is set much smaller than in other browsers ... strange, all other margins are displayed like it should ...

What is the reason for that? Is there a workaround that still uses percentages?


Seeing as this is an x-browser css question, resetting the css styles would be a valuable first step - maybe even the solution. You haven't disclosed any HTML code, so I can't know what other tags or styles are affecting #fbInner

In any case, here is the "meyerweb reset" stylesheet: http://meyerweb.com/eric/tools/css/reset/

Link it topmost in your HTML file. It will probably break your site, but that's a good thing. At least it should be equally broken in all browsers now. When you've fixed the look of your page, it should work properly in most/all browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜