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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with positioning icons with z-index: (very little code)

    I would like my icons to always be in the same place, to the right, no matter what resolution. the site is not set to expand, it is "stuck"/specified at 780px wide.

    How can I achieve this? The icons are currently 32x32 pixels.

    Here is some code I hacked up, but it doesn't work the way I would like. Everytime the res is change the icons move out of the place I would like them to stay.

    I hope this is clear, and can be done,
    Thanks.


    CSS code
    Code:
    #icons {
    position:absolute;
    z-index:10;
    left:90%;
    top:1px;
    }
    also here is my container code so you can get a better idea of whats going on.
    Code:
    #container {
                 
                 width:760px;
    	border: 1px solid #000000;
    	margin: 0 auto;
                 height: auto;
    }
    Html Code
    Code:
    <div id="icons">
    <img src="images/icon.gif" />
    <img src="images/icon.gif" />
    </div>
    Last edited by csshelp; 12-08-2006 at 09:19 PM.

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Code:
    #container {
     position: relative;
     width:760px;
     border: 1px solid #000000;
     margin: 0 auto;
     height: auto;
    }
    Absolutely positioned items are positioned relative to a relative container. Since their container (#container) wasn't declared relative, the icons were being placed relative to the browser window, which was moving all around.

    p.s. Please don't use the "very little code" teasers in your titles. It's just annoying.

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rmedek View Post
    p.s. Please don't use the "very little code" teasers in your titles. It's just annoying.
    Thanks, and sorry. I just figured i'd let people know what they were in for.

    I will not use it in the title again.

    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
    •