h1 next to an image

I fell a bit daft asking this but all I want a h1 to sit next to an image

<a href="http://"><img src = "logo.jpg"></a><h1>heading</h1>

puts the header under the image.

Thanks

Options could be:

Float the link and the heading and they will line up.

Float the link and the heading will go up.

Display the heading-block as inline and it will share the same text line as the inline link.

Test to find what suits your layout. :slight_smile:

And how would i do this?

Display the heading-block as inline and it will share the same text line as the inline link.

Thank you

In some cases it might be more appropriate to have the logo and heading all in the h1.


<h1><a href="http://"><img src = "logo.jpg"></a> Heading</h1>


h1 img {float:left;margin:0 5px 0 0}

And how would i do this?
Quote:
Display the heading-block as inline and it will share the same text line as the inline link.

Assuming that your anchor and image are still inline display elements you would just set the h1 to display:inline.


h1{display:inline}

1 Like

Thanks Paul that’s great!