Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text on button

Status
Not open for further replies.

fullmoon2

Technical User
Aug 14, 2005
20
0
0
Hi

I have made a button with text which lies into a <div> with a class in HTML. I wonder how I can move the text up or down on the button? I've tried padding and "text-align: center" without success. Please help!

This is the css-code:
#hk .kassen {
background: url(../designbilder/btn_kassen.png);
width:84px;
height:30px;
margin: 1px 0 0 -40px;
border: none;
position: absolute;
color: #fff;
}
 
Vertical centering in HTML and CSS is not easy. And the solution depends on what you're doing. If you only have one line of text, then switching [tt]height: 30px;[/tt] with [tt]line-height: 30px;[/tt] will do the trick. If you need more than one line, then the solution is much more complex.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top