Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   Horizontal and Vertical centered div (http://www.go4expert.com/forums/horizontal-vertical-centered-div-t17602/)

webwss 19May2009 11:18

Horizontal and Vertical centered div
 
Can anybody share code for Horizontal and Vertical centered div as I am not able to get it.

shabbir 19May2009 19:43

Re: Horizontal and Vertical centered div
 
Try

HTML Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style>
div.album {
padding-top:25%;
height:50%;
width:100%;
background-color: green;
text-align:center;
vertical-align:middle;
}
</style>
</HEAD>
<BODY>
<div class="album">
This is some text
</div>
</BODY>
</HTML>



All times are GMT +5.5. The time now is 06:11.