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 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    CSS image positioning

    I have this site whereby I want to put an image in a fixed positon on a site relative to the div that it is in. So I've read about it and it's not coming out the way I want it so I'm looking for assistance. What I want to do is this

    But I have this

    The code I'm using on the image in the HTML is this.
    Code:
    <div style="position:relative;"><img src="images/shani.png"  class="pos_fixed"/></div>
    The code in the CSS file is this
    Code:
        
    div.pos_fixed
    {
    /*position:inherit;*/
    position:absolute;
    top:461px;
    /*right:5px;*/
    left:0px;
    }

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,263
    Thanks
    10
    Thanked 277 Times in 276 Posts
    Change this:
    Code:
    div.pos_fixed
    to:
    Code:
    img.pos_fixed
    since you're applying the class to an img, and not to a div. That should get you going in the right direction.

    Dave

  • Users who have thanked tracknut for this post:

    misslilbit02 (09-05-2011)

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    thanks

    This helps alot!!

  • #4
    New Coder
    Join Date
    Jul 2005
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I've gotten a solution Thanks!


  •  

    Posting Permissions

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