Possible duplicate:
How to vertically align the image
The image is resized, but the div is fixed.
This is CSS, but not working. Is it possible to achieve this without using the CSS background function.
This is the CSS class in which the image is pasted.
.PI { top: 25px; position: absolute; width: 239px; height: 120px; line-height:120px; text-align: center; left:-2px; border-top: 1px solid #f7f7f7; background: #b5aeb1; background: -webkit-gradient(linear, left top, left bottom, from(#d9d9d9), to(#b5aeb1)); background: -webkit-linear-gradient(top, #d9d9d9, #b5aeb1); background: -moz-linear-gradient(top, #d9d9d9, #b5aeb1); background: -ms-linear-gradient(top, #d9d9d9, #b5aeb1); background: -o-linear-gradient(top, #d9d9d9, #b5aeb1); -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0; -moz-box-shadow: rgba(0,0,0,1) 0 1px 0; box-shadow: rgba(0,0,0,1) 0 1px 0; text-decoration: none; vertical-align: middle; } .PI img { margin: auto; vertical-align: middle; }
html css image vertical-alignment
MonsterMMORPG Sep 07 '11 at 15:31 2011-09-07 15:31
source share