<html>
<body>
<div style="background-color:red;position:absolute;width:400px;top:50%">
[non-breaking-space]
<div style="background-color:blue;width:50px;position:relative;top:-50%;">
[non-breaking-space]
</div>
[non-breaking-space]
</div>
</body>
</html>
I have a very basic CSS question! :]
Is there any reason for that div to have absolute positioning? (I'm by far no web expert but) I don't see any reason for that to have absolute positioning.
Anyway, first google result right here:
http://www.jakpsatweb.cz/css/css-vertical-center-solution.html
Let me know if that helps ;-)
Anyway, first google result right here:
http://www.jakpsatweb.cz/css/css-vertical-center-solution.html
Let me know if that helps ;-)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement