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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Div Container Width Problem

    Hi,
    Please see the code below.
    In IE it all looks fine as the container neatly encloses the content.
    However in Chrome and Firefox the container does not expand to the width of the content.

    I would be really grateful if someone could modify the code below and post it here so that it works on all browsers!

    I have made the container background black to make it really clear what the problem is.

    Thanks in advance for any help!
    Simon


    Code:
    <html>
    <head>
    <title>CSS Test</title>
    </head>
    <style>
    #container
    {
    width: auto;
    padding: 30px;
    border: 10px solid #ccc;
    background: #000000;
    }
    </style>
    	
    <body>
    <div id='container'>
    <table border=1 width=2000><tr><td>This is a test</td></tr></table>	
    </div>
    </body>
    </html>

  • #2
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    displays for me, albeit my resolution is only 1680x1050 so the table extends past it

    what exactly are you trying to do


  •  

    Posting Permissions

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