This may not be possible with css.
We have the following:
As the window size of the browser is altered the image will change size, but the overall height will remain an absolute 1000px. Since the image is changing height and the height of the child divs are not set the top div with image will take up a greater or lesser percentage of the parent div with the lower div with text taking up the remainder of the parent div height.Code:<div style="height:1000px;"> <div style="float:left;width:100%;"><img src="test.jpg"></div> <div style="float:left;width:100%;padding-top:50%;">test</div> </div>
What I am trying to get is the text to be vertically aligned even as the height of the divs change with the resizing of the browser window.
Is this even possible? I have not seen it anywhere nor have I had any luck in creating this.



Reply With Quote
. Still, it seems that this should be possible even if it is not. Javascript might be able to do this, but I'd rather it be done with css. Javascript is fine though I guess.
Bookmarks