More Silly Floaty Stuff

Ok, again just making a note to myself… sorry, nothing too interesting here for normal people…

Problem #1
There is a bug in Internet Explorer that means that if you float a div left with a left margin and there are no preceding float lefts in the containing box, the margin will be doubled! Great! :-( . Same thing happens with right divs.

Two fixes are known. One is to add a “display: inline” to the div style. This apparently works because of another bug in IE. Therefore I’m reluctant to use it. An alternative is to put the floated div inside another div and float that one left with a padding. That way you don’t have to put the margin in the inner div and it doesn’t get doubled.

Problem #2
In the process of making the above fix I discovered another problem, which is possibly a bug in Firefox. It looks like you can’t do a float left and a float right on the same line. Firefox puts the second one on a new line. This is at least true if the width of the divs is not explicitly specified (actually now I think about it, don’t floated divs have to have an explicit width? – must check that).

The solution I used for this was to just float left both divs. They end up next to each other and I used padding to ensure that they had the right separation between them.

All nasty stuff. So that’s how I spent most of my Saturday, apart from figuring out how to move a template I had created on my laptop to my server.

Also bought a half a terabyte of external disk storage for 150 bucks. I think my internal drive may be close to failure, so time to back-up.


This entry was posted in Archive. Bookmark the permalink.

Comments are closed.