SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist escapedf's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy screen resolution affecting my Position: absolute

    hi all..my website looks fine with screen resolution 1366..: http://bluecrushdesign.co.za/imagin82/ But my client has a screen resolution of 1024 x 768and when i change my resolution down to this, my nav links and left & right arrows move all the way to the right.This code for nav links and left & right arrows are not available to edit in the HTML, the js spits it out..Anyhing i can do in the css for div #coda-nav-1 so that it looks good on both resolutions?appreciate the help!
    "have the courage to follow your heart and intuition. They somehow already know what you truly want to become"

  2. #2
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Firstly, fixing a main menu 1080px to the right is not a good idea. As you've seen, it makes the site harder to use for anyone with a narrower viewport. The most usable position for a vertical menu is left.

    #coda-nav-1 is set to position:absolute; which means that it is taken out of the flow of the document and positioned in relation to either a parent that has position:relative; or, if no such element exists as is the case here, the body element.

    If you want the menu to hang with the rest of the content of #wrapper, which is centred within body with a fixed width of 1010px, you could give its immediate parent - .coda-slider-wrapper - position:relative; and remove the left properties (there are two currently set) from #coda-nav-1. The menu will then, due to the 10px left/right margins on .coda-slider, sit 10px to the left of the left edge of the slides. If you want the left edges to align, give #coda-nav-1 margin-left:10px;

    Having done the above, you'll notice that the left and right controls have vanished. This is due to their now being positioned in relation to.coda-slider-wrapper and further right than that elements fixed width. You'll need to decide whether it is best for usability for the left and right controls to be on the right or left. Again, I would go for left, as it puts them in sight for far more users. For this, remove left: 1080px; on both .coda-nav-left and .coda-nav-right. As for the menu, give them margin-left:10px if you want them to align with the slide.

    Here's the result (at 50% size).



    Code CSS:
    .coda-slider-wrapper {
        clear: both;
        overflow: auto;
        position: relative;
    }
     
    #coda-nav-1 {
        position: absolute;
        width: 100px!important;
        z-index: 10000;
        top: 40px;
        background-image: url(../images/content.png);
        height: 65px;
    }
     
    .coda-nav-left {
        position: absolute;
        top: 300px;
        z-index: 200;
    }
     
    .coda-nav-right {
        position: absolute;
        top: 350px;
        z-index: 200;
    }
    Last edited by Victorinox; Dec 1, 2011 at 09:56. Reason: Added CSS

  3. #3
    SitePoint Evangelist escapedf's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks ill have a read through!the client actually wants the menu and arrows on the right side though ;-) ps how did you put line breaks in your post?
    "have the courage to follow your heart and intuition. They somehow already know what you truly want to become"

  4. #4
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    So the client is happy as long as the navigation fits on their browser.

    I see you've followed the positioning suggestion but used left:900px; For aligning right edges right:0; is arguably more apt. You've still two declarations for left in #coda-nav-1. ie. left:100px; can go.

    Line breaks? Just hitting enter, as usual. Do you mean in the CSS? I write and format posts in a text editor then paste them in, using the Syntax highlighter with the appropriate type for the code.

  5. #5
    SitePoint Evangelist escapedf's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aaah it just seemed to work without taking those out so i just left it . true about right:0, bu its at client now dont want to change things for the mo..yeah line breaks in this post in sitepoint, hitting enter doesnt work for me.. maybe its a firefox 7 thing..You wouldnt know how to change the right to actual images? its all in the javascript code.. when i ever get proficient enough to post a JS slider or feature online ill def make sure most of it is in the HTML for designers to customise !!
    "have the courage to follow your heart and intuition. They somehow already know what you truly want to become"


Bookmarks

Posting Permissions

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