Create header in html

VBdotnet2005
VBdotnet2005 used Ask the Experts™
on
I want to create a header area where I can place a logo on the left and menu, like mine image. Right now my header width does not go all the way to right and there is gap on top of header and also on the left size. What should I do?
<table height="125" width="100%" border="0">
				<tr>
				
					<td valign="top" align="left" bgcolor="#EDEDED">
                        <asp:Image ID="Image_logo" runat="server" ImageUrl="~/images/mylogo.gif" />
					</td>
				
				</tr>
				
				</table>

Open in new window

header.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Systems Administrator
Commented:
You can do this much easier with CSS as opposed to a table. Here is some code to get you started. You will need to adjust the values based on your image.

Normally I use a separate stylesheet and link to it. If you want to do that, I have also included code for that method as well.

INLINE CSS:

<html>
<head>
	<style>
		#HEADER {
			width: 100%;
			height: 125px;
		}
		.HEADER-IMG {
			align: left;
			width: 150px;
			height: 100%;
		}
	</style>
</head>
<title></title>
<body>
	<div id="HEADER">
	   <img src="INSERT IMAGE LOCATION HERE" class="HEADER-IMG">
	</div>
</body>
</html>

Open in new window


LINKED CSS:

HTML:
<html>
<head>
	<link rel="stylesheet" type="text/css" href="style.css">
</head>
<title></title>
<body>
	<div id="HEADER">
	   <img src="INSERT IMAGE LOCATION HERE" class="HEADER-IMG">
	</div>
</body>
</html>

Open in new window


Stylesheet:

#HEADER {
			width: 100%;
			height: 125px;
		}
.HEADER-IMG {
			align: left;
			width: 150px;
			height: 100%;
		}

Open in new window

Your global css stylesheet might have table with pixel width applied now...
Please check it in inspect element in browser.

If you are using a fresh html page, then you can use as Zac Harris mentioned above.

Do you have a online url of working?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial