Hi, so i have recently started xhtml at college and we have to build a website as part of an assignment. soi have been writing it up in notepad++
but theres one simple thing thats bugging me
[IMG]http://i53.tinypic.com/2rqftia.png[/IMG]
i cannot get the home smack bang center of the button i have used text-align: center; to center it horizontally but i cant get it aligned vertically.
i have tried using vertical-align: text-middle; but to no avail.
so can anyone help me?
Vertical-align's a bitch. IIRC it only works in tables.
Try using padding on the button.
just gave padding a go, the only thing it did was make the button bigger. so thats a no go.
Why wouldn't this be postable in the "Web Development Questions That Don't Need Their Own Thread" thread?
usually when i post in a thread like that, i get ignored.
[QUOTE=Mak123;28069156]just gave padding a go, the only thing it did was make the button bigger. so thats a no go.[/QUOTE]
Reduce the height of the button and add padding.
Lets say that your button is 40px. The text is at the top.
Reduce your buttons height by 10px and add padding-top: 10px;
The button stays the same size but the text is now lower.
[i]No time to test for the best solution now, gotta get going. Sorry[/i]
that works like a charm cheers dude.
this thread can be closed now.
You're suppose to set the line-height to the height of the element. That way the text will always float in the middle. Then you you can add side padding or set a width.
[QUOTE=jaybuz;28071203]You're suppose to set the line-height to the height of the element. That way the text will always float in the middle. Then you you can add side padding or set a width.[/QUOTE]
Thanks, I was thinking there was some better solution but couldn't get it in my head.
Sorry, you need to Log In to post a reply to this thread.