Welcome to WebmasterWorld Guest from 107.20.34.173

Message Too Old, No Replies

Is it okay to put an image in a header tag?

     

OrganicPop

3:42 am on Mar 15, 2011 (gmt 0)

5+ Year Member



I want to put an image inside an h2, next to the content for the h2, because the image would line up better. Is there anything to consider as far as semantics or hierarchy when doing so?

TheMadScientist

3:51 am on Mar 15, 2011 (gmt 0)

WebmasterWorld Senior Member themadscientist is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



I doubt it will cause any issues, but if you have room for both you could probably set a width on each and float the h2 to one side and the image to the other, which would keep them separated.

OrganicPop

4:07 am on Mar 15, 2011 (gmt 0)

5+ Year Member



thanks tms.

TheMadScientist

4:14 am on Mar 15, 2011 (gmt 0)

WebmasterWorld Senior Member themadscientist is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Np ... Just remember if you float elements you'll want to clear your floats or you may get unexpected and undesired formatting on other elements.

topr8

10:41 am on Mar 15, 2011 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



heading: h1, h2, h3 etc

header: a new tag in html5 to designate a header.

header: also conventionally used to describe the top of the page where the logo etc is located, there was no specific tag (before html5) to define this

almighty monkey

12:05 pm on Mar 15, 2011 (gmt 0)

5+ Year Member



Eek, in my experience text H2 has definite value. If your dead on doing this, make sure you give the image a decent alt tag.

We're at a point, right now, pre-HTML5, where if using text for things like headings isn't viable in the design, I'd redesign. If you don't have great headings, and your competior does, you've got to do way more offsite stuff to keep up. Your potentially creating a mammoth task down the line in the name of saving a bit of time now. Shortcuts make long journeys and all that.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month