can someone PLEASE tell me the code for css for this HTML: <table cellspacing="0" cellPadding="0" width="1000" border="0"> <tr> <td width="450" bgcolor="#FFFFFF" align="left"><img src="logo.jpg" alt="logo title"></td> <td width="550" align="center" bgcolor="#FFFFFF">Some TEXT. some text.</td> </tr> </table> Code (markup): thanks in advanced.
Try this XHTML <div id="table"> <div id="left"><img src="logo.jpg" alt="logo title" /></div> <div id="right">Some text</div> </div> Code (markup): CSS #table { width: 1000px; } #left { float: left; width: 450px; background-color: #ffffff; text-align: left; } #right { float: left; width: 450px; background-color: #ffffff; text-align: center; } Code (markup):
I would probably approach that a bit differently... <div id="header"> <img src="logo.jpg" alt="logo title" /> <p> Some TEXT. some text. </p> <!-- #header --></div> Code (markup): and the CSS: #header { overflow:hidden; /* wrap floats */ width:1000px; /* also trips haslayout, so floats are wrapped in IE 7/earlier */ background:#FFF; text-align:center; } #header img { float:left; } Code (markup): Though this makes a lot of assumptions (the image is 450px, etc, etc). I'm rabid about getting as much as possible out of the HTML and using as few unneccessary wrappers as possible.