...

View Full Version : H and V centered div



traucostar
05-19-2009, 06:16 AM
Hello!
Hope someone can help me.

I have this (The image is H and V Centered):
http://img36.picoodle.com/img/img36/2/5/19/traucostar/f_a1m_cda5026.jpg

But I need this:
http://img29.picoodle.com/img/img29/2/5/19/traucostar/f_a2m_3d09a89.jpg


<style>
div.album1 {
padding-left:auto;
padding-right:auto;
height:120px;
width:120px;
background-color: green;
text-align:center;
vertical-align:middle;
}
div.album2 {
height:100px;
width:100px;
background-color: blue;
display:table-cell;
position:relative;
vertical-align:middle;
}
</style>

<div class="album1">
<div class="album2">
<img src="1.jpg">
</div>
</div>

Thanks!!!

abduraooft
05-19-2009, 09:04 AM
Why do you need an extra div to show that border? Can't you use a thick border around your image or a div?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum