Forum Moderators: not2easy

Message Too Old, No Replies

Aligning image in a header

         

Seraphyx

5:26 pm on Jun 10, 2009 (gmt 0)

10+ Year Member



Hello, I am very new to html, css, and everything of the sort.

I'm having issues aligning an image in a div header. The image is cropped at the top, so I need it to be touching the top border of the header.

<div id="header">
<h1><img src="image236274.png" alt="" width="775" height="100" align="top" /></h1>
</div>

I am also using dreamweaver cs3.

Thanks in advance for any help.

abidshahzad4u

2:18 pm on Jun 11, 2009 (gmt 0)

10+ Year Member



Try this in your CSS file

#header img
{
margin-top:0px;
vertical-align:top;
padding-top:0px;
}

dreamcatcher

6:07 am on Jun 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Seraphyx, welcome to WebmasterWorld. :)

You should also remove the h1 tags. No need for them if you are using an image. IE will apply default padding to h1 tags, preventing you aligning flush with the header div, so if you do for some reason require the h1 tags, you should also remove the padding. So, add the following to code as well:

#header h1 {
padding:0;
}

dc