Help
-
Search
-
Members
-
Calendar
Full Version:
Vertically center text within a div.
HTMLHelp Forums
>
Web Authoring
>
Cascading Style Sheets
NovaArgon
Aug 10 2009, 02:54 PM
How do I vertically center text or add padding to it without moving the whole div?
Right now the text is sitting on the bottom of the div.
CODE
#footer {
color: #FFFFFF;
background: url(images/bottom.jpg) repeat-x;
font-weight: bold;
}
Thanks
Beakers
Aug 12 2009, 11:03 AM
Could just go with:
#footer span{
top-margin:-20px;
}
then just place your footer text in a <span></span> and it will be moved up by 20px.
Without seeing the source and the reason its moving your text to the bottom of the div I cant suggest much else.
Iain
Frederiek
Aug 12 2009, 12:35 PM
See
http://www.w3.org/Style/Examples/007/center
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here
.
Invision Power Board © 2001-2009
Invision Power Services, Inc.