Forum Moderators: open
IMAGE
(60% of div-height)line of text
line of text
line of text
Ok heres the deal: my image is position:relative, right? and its height is 60% of the div. In IE, the div, which is sized in Pixels, resizes to fit the image inside of it (width-wise). In mozilla, the div does not resize. Now, I suppose someone is in the wrong here (*probably IE*)
OK another issue: my lines of text actually are too big for the div, so again, IE resizes, but Mozilla just keeps the div the same, and the text overflows.
So whats a good solution?
but I can see that i was wrong. (*after all, why is their an overflow paramter?*)
Well, so I just dont set any size for the div, and let the image decide how big I want the div to be. This works for me just fine.
Though I dont have quite as much control as I would like...
Well, so I just dont set any size for the div, and let the image decide how big I want the div to be. This works for me just fine.
That's probably the simplest answer. The next shot would be declaring a value for overflow (auto?) That offers you more control, but you'd need to understand the reasons for the overflow so you set it wisely.
Whaddya think stylistically?
ANother issue: when I first came to this forum, I was indoctrinated with the idea of div within a div for borders and such.
Well, heres a problem:
Say you want a border around an image, and you put it inside a div. Well.... In Mozilla, its just going to overflow, and look bad, and since an image overflows its containing div with a border, I can see no way to fix this other than setting its left:(1 pixel to right of div) and its width to 2 pixels smaller than the div,(for a 1px border) and this means No percentages ;(
Sigh.
Can you think of any workarounds? that are somewhat elegant? Or just forget borders around the image. Ok this is only a problem if you want the image to be as big as the containing div (which I do)
And sadly, a div wont resize in mozilla due to text inside of it, but IE will...