html/css
•
25 Aug 2010, 17:52
•
Journals
I'm trying to learn this shit.
How do I vertically align text in a simple div?
I found "vertical-align" but whatever value I add behind it, it's not working.
Any pro's out there that I could ask some questions every now and then?
How do I vertically align text in a simple div?
I found "vertical-align" but whatever value I add behind it, it's not working.
Any pro's out there that I could ask some questions every now and then?
http://www.w3schools.com/css/
Here's what I got:
html
css
output
So what do I add and where?
Margin: 50% 0 50% 0;
padding: 0;
}
??????
PS: Web developing is really easy as long as you have working internet :-)
EDIT: how about this (if the above doesn't work)
#Header h1 {
vertical-align: middle;
}
U
R
T
E
X
T
I think vertical-align is for images only.
http://www.student.oulu.fi/~laurirai/www/css/middle/ here is something on the topic
E: SCratch that, see what Defix below said. Now that I think about it, it should work - I haven't done web developing in ages but I recall being stumped with the same problem you are.
Edit: Oh you said vertically.
Give the div a fixed size like 16em, then add a line-height from 8em and put a <br> infront of the text
Quick'n'Dirty :D
No, seriously, this should do it:
margin-top:auto;
margin-bottom:auto;