Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member Sean Thompson's Avatar
    Join Date
    May 2012
    Posts
    106
    Member #
    31720
    I would like to make a site that mimicks this layout weightlosspillstalk.com . Here is my problem:

    How do I make the content "always centered" with the background in margins or padding on the side that shrinks with the browser(down to a minimum width of 940 px)?

    Probably an easy question for anyone with any experience- this is how pretty much all websites are

    Thanks
    Sean

  2.  

  3. #2
    Member paulo f's Avatar
    Join Date
    Jan 2013
    Location
    Im about here.
    Posts
    50
    Member #
    34366
    1. Create a div element as the main element on the page where you'll store everything on the page.
    2. Give that div element an ID that is unique on the page.
    3. Open your CSS style sheet and set the width of your div element.
      div#main {
      width: 960px;
      }
    4. Add automatic margins to center your div.
      div#main {
      width: 960px;
      margin-left: auto;
      margin-right: auto
      }





      If you have a minimum size then people with smaller screens will have to scroll the website.
    <Signature Here/>

  4. #3
    Senior Member Sean Thompson's Avatar
    Join Date
    May 2012
    Posts
    106
    Member #
    31720
    MASSIVE THANKS! It's not usually that I find such a quick fix to these coding mysteries.

    Thanks Paulo

  5. #4
    Senior Member Sean Thompson's Avatar
    Join Date
    May 2012
    Posts
    106
    Member #
    31720
    If you can help me with the next problem- when I scroll down the image repeats itself after a while.

    How do I make the background NOT vertically repeat and just be white when you scroll down?

  6. #5
    Member paulo f's Avatar
    Join Date
    Jan 2013
    Location
    Im about here.
    Posts
    50
    Member #
    34366
    Glad to help.

    Add this line of CSS to the backgound.

    background-repeat: no-repeat;
    <Signature Here/>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:05 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com