Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    264
    Thanks
    49
    Thanked 1 Time in 1 Post

    what is causing Body tag to become wide?

    Hi. This site is using a test Wordpress theme.

    For some reason the body is much wider than anticipated.

    I can't see any HTML or CSS which is doing this.

    Can you?

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    What width did you anticipate it to have?
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    264
    Thanks
    49
    Thanked 1 Time in 1 Post
    no more than 100% of the browser width

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,139
    Thanks
    7
    Thanked 257 Times in 256 Posts
    Do you use any of the html debugging tools, like Firebug for Firefox, or the built-in Developer Tool in IE? They let you examine your html and css very easily, and if you look at your site you can tell exactly what css is setting the width of this page to 960px.

  • #5
    Regular Coder
    Join Date
    Sep 2011
    Posts
    264
    Thanks
    49
    Thanked 1 Time in 1 Post
    I use Chrome code inspector, and I see that #container is set to 960, but that the body is much wider than this, and code inspector does not show any HTML or CSS code generating this extra width.

  • #6
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    I'm confused...why wouldn't it just be 100% wide by default?
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #7
    Regular Coder
    Join Date
    Sep 2011
    Posts
    264
    Thanks
    49
    Thanked 1 Time in 1 Post
    I'm confused too. I can see that the page scrolls to the right, which it shouldn't, because there is no content there.

  • #8
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,139
    Thanks
    7
    Thanked 257 Times in 256 Posts
    I can't spot it. But you might stick a xhtml doctype at the top of the file and see if you can fix the various validation issues...

  • Users who have thanked tracknut for this post:

    SRD75 (07-26-2013)

  • #9
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    FF's web developer tools show that html and body are both the normal width, and are not the cause of the excessive width.

    I can't see any other elements that are making it happen, either. Try adding a DOCTYPE.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • Users who have thanked whizard for this post:

    SRD75 (07-26-2013)

  • #10
    Regular Coder
    Join Date
    Sep 2011
    Posts
    264
    Thanks
    49
    Thanked 1 Time in 1 Post
    Thanks. I think adding the doctype has resolved the issue in Chrome.

  • #11
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Still having the issue in FF... :\
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #12
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,139
    Thanks
    7
    Thanked 257 Times in 256 Posts
    Just for grins, remove visibility:hidden from the style for #mainmenu ul ul. That will show you how your sub-menu items are laid out, which is really wide. I don't have a solution for re-coding those drop-down menus, but hopefully this is a useful pointer...


  •  

    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
    •