SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A better foundation..

    A built a mockup of a site.

    The middle content section needs to be fixed width at a certain point because the layout will get screwed up.

    How can I accomplish that with the below architecture/css? The right column has consistently plagued my boss and I, it would slip under the center content and look ugly, I just passed it off as being a mockup--a demo.. well the "demo" has grown and matured and is constantly viewed and built upon.. how can we not allow the right column to go "UNDERNEATH" the center content if the resolution gets smaller?

    /* All the content boxes belong to the content class. */
    .content {
    position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */
    width:auto;
    min-width: 220px;
    margin:0px 220px 20px 210px;
    background-color:white;
    padding:10px;
    z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */
    }

    #navAlpha {
    position:absolute;
    width:190px;
    top:120px;
    left:15px;

    padding:1px;
    z-index:2;

    /* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
    Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
    IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
    declaration. The incorrect IE5/Win value is above, while the correct value is
    below. See http://glish.com/css/hacks.asp for details. */
    voice-family: "\"}\"";
    voice-family:inherit;
    width:190px;
    }
    /* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
    length values to user agents that exhibit the parsing error exploited above yet get
    the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
    a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
    body>#navAlpha {width:190px;}

    #navBeta {
    position:absolute;
    width:210px;
    top:120px;
    right:15px;
    padding:1px;
    z-index:1;
    /* Again, the ugly brilliant hack. */
    voice-family: "\"}\"";
    voice-family:inherit;
    width:198px;
    }
    /* Again, "be nice to Opera 5". */
    body>#navBeta {width:198px;}
    http://www.jojowebdesign.com
    "In the end, more is actually said, than done.."

  2. #2
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really would need a link to the mockup online to sort this - partial code doesn't mean much.

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LInk

    For privacy reasons I will remove the link later.

    http://smcusa.com/ver2/index.html

    Thank you for any insight.
    http://www.jojowebdesign.com
    "In the end, more is actually said, than done.."

  4. #4
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Add a wrapper div around the entire content in the body. Set an appropriate min-width for wrapper such that it doesn't break when the viewport is reduced. (I've just measured it at 983 px, but there is also something that causes a permanent horizontal scrollbar in IE7)
    Add a conditional statement after the last css file in the head, to set the min-width for early versions of IE.

  5. #5
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OR
    Set the size of the image which slides over the right-hand column as a percentage, and it will get smaller in line with the viewport.

    EDIT
    Ah that didn't work, the image then overlaps the text below it at wider viewport sizes.

    Stick with the min-width/conditional statement suggested above.

  6. #6
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Will second Dr John's wrapper suggestion.

  7. #7
    SitePoint Guru james_littler's Avatar
    Join Date
    May 2007
    Location
    Portsmouth, UK
    Posts
    775
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    easy way to achieve min width with no hack is to have a div width:300px; height:0px put this within the div in question and when it reaches the edge of the stop div it will go no further.. there you have min width, the same applies for min height


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
  •