Dead centre a div
body | |
{ | |
margin: 0px | |
} | |
#horizon | |
{ | |
color: white; | |
background-color: #0ff; | |
text-align: center; | |
position: absolute; | |
top: 50%; | |
left: 0px; | |
width: 100%; | |
height: 1px; | |
overflow: visible; | |
visibility: visible; | |
display: block | |
} | |
#content | |
{ | |
position: absolute; | |
left: 50%; | |
width: 250px; /* Overall width of div */ | |
height: 70px; /* Overall height of div */ | |
top: -35px; /* half of the overall height */ | |
margin-left: -125px; /* half of the overall width */ | |
visibility: visible | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment