How to have fluid header and fixed body?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • durruti
    Senior Member
    • Jan 2012
    • 489
    • 4.1.x

    [vB4] How to have fluid header and fixed body?

    Something like this:
    Business Insider tells the global tech, finance, markets, media, healthcare, and strategy stories you want to know.


    No options to do it in the Style Variable Editor, so I assume template edit.







    Also, can this option be added into the next release?
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    For the above_body class, you could just enter a negative margin to what you have in the body. For instance, if you body has left/right margin of 35px, then just add:

    .above_body {margin-left: -35px; margin-right: -35px}

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools <- awesome site for html/css help

    Comment

    • durruti
      Senior Member
      • Jan 2012
      • 489
      • 4.1.x

      #3
      It works in the default skin but it doesn't keep the body width fixed.

      In the stylevars I did the following:
      doc_margin; I set left and right to auto
      doc_width; I set the width to 1000px

      What value should I add to margin left and right for .above_body?
      One more thing, for .above_body, can this change be done in the corresponding template itself instead of additional CSS?

      Comment

      • Lynne
        Former vBulletin Support
        • Oct 2004
        • 26255

        #4
        If you aren't going to use a set margin, then you will need to set the doc_margin to 0 and doc_width to 100% and then add this to additional CSS (there are no stylevars for it):
        HTML Code:
        .body_wrapper {width: 1000px; margin-left: auto; margin-right: auto;}



        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools <- awesome site for html/css help

        Comment

        • durruti
          Senior Member
          • Jan 2012
          • 489
          • 4.1.x

          #5
          Nice, works like a charm.

          One last question;
          Do I need to change doc_maxWidth (default; auto) and doc_minWidth (default; 650px) to any corresponding numbers as well?

          Thanks in advance.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...