Skip navigation
Keitodd29
Currently Being Moderated

Liquid Page Layout

Sep 13, 2012 7:05 PM

I have created a liquid 2 column, header and footer page. I would like to move the body of the page down 6% so my background color is viewed at the top, sides, & bottom.

 

I have changed the body top margin to 6% and the body has moved down in live view but is flush with the top when viewed in my browsers?

 

Is there anything additional I need to do?

 

Thanks

 
Replies
  • Currently Being Moderated
    Sep 13, 2012 9:10 PM   in reply to Keitodd29

    If you post a link here of your test page then we can provide the css code to enter manually to make the appropriate changes.

     

    Good luck.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 14, 2012 1:18 AM   in reply to Keitodd29

    Ideally, use the bgcolor in your body element. Use another div such as wrapper or container to hold your content. Provide margins as desired for this main content container. For example:

     

    CSS:

     

    body{

    bgcolor: #ccc;

    }

    #wrapper{

    margin: 6%;

    }

    HTML:

     

    <body>

       <div id="wrapper">

       content here

       </div>

    </body>

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 14, 2012 8:34 AM   in reply to Keitodd29

    Most common workaround:

     

    az_hp_layout.css - line 2

     

    under body, change margin:

     

    margin: 6%;

     

    6% is what you wanted but in my opinion, will be too big a spacing. You could play with the values - start with around 30px or 40px and see what you like best.

     

    Best practice:

     

    Don't touch the body element code.

     

    Under line 40 of your az_hp_layout.css, for container class, add margin:

     

    margin: 40px auto;

    Change the value from 40px to whatever you prefer. This will offset anything inside 'container' div by the marign value you provide. The auto tag is to center the container on screen. If you remove auto, your container element will by default be shown on the left hand side with 40px margin on left, top and bottom.

     

    Trust this helps.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 14, 2012 8:38 AM   in reply to Keitodd29

    Another best practice - not related to your question, but thought of pointing it out to you:

     

    I see that you've written your container element to be a class. Key page elements such as header, container & footer are ideally used only once per page. It's best that you write these as Div ID's instead of Classes. Instead of .container, you will have #container. This helps you target object-specific CSS rules to your elements. If you decide to change to ID, your HTML code will be <div id...> instead of <div class...>

     

    You can read about this here:

    http://www.w3schools.com/css/css_id_class.asp

    http://www.tizag.com/cssT/cssid.php

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 12:17 PM   in reply to Keitodd29

    Change <div class="container"> to <div id="container">

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 14, 2012 10:37 PM   in reply to Keitodd29

    As I had written earlier, ID is for targeted elements (mostly one instance per page) and CLASS is for multiple instances.

     

    In CSS, .container means the wrapper is a CLASS. #container means the wrapper is an ID.

     

    Depending on the CSS you write, your HTML should have <div class="container"> if your CSS contains .container and <div id="container"> if your CSS contains #container.

     

    Ideally, container, header, footer, navigation should be div ID's.

     

     

     

    2. Change the <div class="container"> to <div #container> that follows <body> tag and in front of the <div class="header" tag ….etc?

     

    Is this correct?

     

    In your case, if you have changed .container to #container in your CSS file, your HTML should have <div id="container">. This is correct.

     

    Btw, have you tried a shot at one of the readily deployable CMS environments? They should help you a lot - you'll only have to write minimal code. My favorites are concrete5 & drupal at the moment.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 17, 2012 11:19 AM   in reply to Keitodd29

    Really interesting to find out about your inquisite learning curve!

     

    There really is no right or wrong way. DW can merge with either C5 or Drupal - not both. You cannot use C5 and Drupal together on one site.

     

    Considering you mentioned you're looking at an e-commerce site, I'd suggest you take a look at Magento. A great platform for e-commerce websites. Lot of renowned companies use it. http://www.magentocommerce.com/

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 17, 2012 11:21 AM   in reply to Keitodd29

    Magento also has a Community Edition which can be downloaded from here: http://www.magentocommerce.com/download - this is for advanced users who can code/ theme/ style/ customize their websites. Familiarity with code is recommended.

     

    In your instance, I'd recommend the use of Magento Small business edition which will help you get a great looking e-commerce store online in no time!

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    3,731 posts
    Oct 15, 2010
    Currently Being Moderated
    Sep 17, 2012 9:16 PM   in reply to Keitodd29

    Community Edition is open-sourced. I'm not sure if you've heard about 'SugarCRM'. If you have, it's pretty much the same. All functionality is packed into Community edition too. You wont have to convert it to monthly pricing. You can use it for as long as you want, provided, you're familiar with code and you can do customization yourself.

     

    Enterprise Edition is provided to you as SaaS (Software as a Service). Customized & Hosted for you with 24/7 support. For an enterprise plan, you'll be on a monthly/ yearly plan.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points