<div style="width:100%;">
<div style="background-image:url('../images/navi/top-red.png'); float:left;"></div>
<div style="width:180px; float:left"><img src="/images/navi/logo.jpg" style="width:178px; height:62px; float:right; border:0;" /></a></div>
<div style="width:800px; float:left; background-image:url('../images/navi/top-black.png');"><ul id="topnav" style="">NAVI LINKS</ul></div>
<div style="background-image:url('../images/navi/top-black.png');float:left;"></div>
</div>
The main goal is to create a full-width top navigation menu for my website:
--------------------------------- 100% browser width -----------------------------
|top-red.png FLUID | width:180px-LOGO.jpg | width:800px-NAVI LINKS | top-black.png FLUID|
--------------------------------- 100% browser width -----------------------------
Key points:
- Center content fixed at 980px width
- Center content includes logo image and navigation links
- Left space filled with top-red.png background image
- Right space filled with top-black.png background image
I initially tried using div tags, but encountered issues with filling the available space. I resorted to using a table instead:
<table border="0" cellspacing="0" cellpadding="0" style="width:100%;">
<tr>
<td style="background-image:url('../images/navi/top-red.png'); height:62px;"> </td>
<td style="height:62px; width:180px; padding-right:10px;"><a href="/"><img src="/images/navi/logo.jpg" alt="LOGO IMAGE" style="width:178px; height:62px; border:0;" /></a></td>
<td style="height:62px; width:800px; background-image:url('../images/navi/top-black.png')">NAVIGATION MENU</td>
<td style="background-image:url('../images/navi/top-black.png'); height:62px;"> </td>
</tr>
</table>