I am curious about an odd rendering behaviour on Safari 5.1. In a two-column layout, the first column has a fixed width, and the second one should take the remaining part.
HTML:
<div class="row">
<div class="left">
<p>Left</p>
</div>
<div class="right">
<p>Right. Some more text here, to show how odd the line breaks...</p>
</div>
</div>
CSS:
.row { width: 300px; background: yellow; overflow: hidden; }
.left { width: 100px; background: red; float: left; }
.right { margin-left: 100px; background: green; overflow: hidden; }
This works great on most browsers (on all "modern" browsers, as I thought), but now I found out, that Safari 5 adds an unintended right margin on the second column of the same width as the intended left margin (as if there were a .right { margin-right: 100px; }
rule).
Most Browsers:
Safari5: (tested on 5.1.7, but it occurs also on 5.1.9)
When I remove the overflow: hidden;
it works fine, but I need that for other inside elements.
My questions is not how to rearrange this little example, but:
- Is this a Safari-5-Bug, or are my CSS rules somehow wrong, even if they "work" on most browsers?
- If it is a Bug, does it have a name, with which I can google some workarounds?
- Can I detect somehow, which Browsers are affected with this behaviour, to define some exception rules for them.
Update: The standard Android browser (Galaxy S3, AppleWebKit 534.30) seems to use the same old webkit engine. The same strange right margin appears: http://jsfiddle.net/MvF3V/1/embedded/result/