Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm trying to put a 84x80 image on the left of the text everytime I use <H1>, but I don't know how to get the text vertically aligned in the middle.
That's what I've got so far:h1 {
background: url('images/icon.png') no-repeat;
background-position: left;
height: 80px;
padding-left: 84px;
vertical-align: middle; }The vertical-align: middle; doesn't seem to be changing the position of the text. Anyone knows what I'm doing wrong?

Hi, perhaps try assigning a line-height as well. If you have only a single line of text that you want to center and you can specify a fixed-height for the parent element, then set the line-height of the parent element.
For example:
line-height: 500px;
or
line-height:5em

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |