...

View Full Version : CSS Div Container Width Problem



simon391088
08-05-2010, 06:59 PM
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




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

met
08-05-2010, 07:17 PM
displays for me, albeit my resolution is only 1680x1050 so the table extends past it

what exactly are you trying to do



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum