Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    H and V centered div

    Hello!
    Hope someone can help me.

    I have this (The image is H and V Centered):


    But I need this:


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

    <
    div class="album1">
    <
    div class="album2">
    <
    img src="1.jpg">
    </
    div>
    </
    div
    Thanks!!!
    Last edited by traucostar; 05-19-2009 at 07:20 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Why do you need an extra div to show that border? Can't you use a thick border around your image or a div?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •