CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   html and css width problem (http://www.codingforums.com/showthread.php?t=256805)

hmdnawaz 04-10-2012 07:35 AM

html and css width problem
 
Hi,
Look at this website.
http://harleydragon.info

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
Code:

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.

Excavator 04-10-2012 02:38 PM

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!! :eek: 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!


All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.