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 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts

    DIV Width - What am I missing?

    Hey guys,

    I've done around 15-20 nice CSS sites so far without much trouble. I've just started doing a new one.

    I've gotten halfway through and realised my "content" div isn't keeping to it's width like all the previous website have done so.

    I even went right down to only having a html page with a "content" div on with only one parameter in the CSS page, like as so:

    Code:
    div.content {width: 200px;}
    Putting some text inside the div on the HTML page that was longer than 200px, instead of going down to a new line within 200px, it just extends the div along as far as the text goes.

    Have I by chance somehow forgot to learn some basic lesson about div widths here?

  • #2
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Which browser are you viewing the page in? How do you know that the div is expanding and that content is not just overflowing? This you can tell if you apply some background color to the div. You need to show us some code, preferably a link.

    With that said, a div in IE6 (and earlier versions) having overflow: visible will incorrectly expand in width if it holds too wide content. Generally you have to take into account Internet Explorer and the Expanding Box Problem

  • #3
    New Coder
    Join Date
    Feb 2007
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hey thanks that makes perfect sense now, obviously something that I haven't come across yet. All in the learning process I guess.


  •  

    Posting Permissions

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