Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Thanked 0 Times in 0 Posts

    html and css width problem

    Look at this website.

    It has a width problem. Look at the horizantal scrolling. I want to remove that scrolling and fix the width of the site but I am not able to do so. I tried and the
    margin:0 auto
    to the body tag but it did not solve my problem.

    second When I hover the mouse over the last navigation menu item(Pigoen forge) the menu appears but note the horizontal scroll bar, when the menu appears the width of the site increases and the items of the menu appears on the right side which are hidden from the browser window. SO how will I fix it? If the browser window finished then it must display the menu items on the left side.

    Please help me out from these two problems. I tried and spent a lot of time on these issues but cannot fix it.

  2. #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Thanked 1,874 Times in 1,858 Posts
    Good morning hmdnawaz,
    To center an element you need three things:
    1. a valid DocType
    2. an element with a width
    3. that elements right/left margins set to auto

    In your case, putting a 1,000px width on body may not be the best approach since body's background image is larger than that. Put your width and centering on .page instead.

    Mostly you need to clean up some of that CSS!! There is multiple entries for every element in each linked CSS file along with markup, which defiinetly doesn't belong in there.

    See the links about validation in my signature line. Validating will help you a lot!
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


Tags for this Thread

Posting Permissions

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