Mobile app version of vmapp.org
Login or Join
Cooney921

: Header Tags with image and SEO Is this bad for SEO? The designers came up with it. Basically there is an icon next to each Header Text. So for each page and the respective header there

@Cooney921

Posted in: #Html #Seo

Is this bad for SEO?
The designers came up with it. Basically there is an icon next to each Header Text. So for each page and the respective header there is an icon associated with the page.

Markup:

<h1>
<span class="span"><img class="spanImg" src="../img/pageIcon.png"></span>
<span class="text">Header Title Text Here</span>
</h1>


CSS:

.span, .text {
vertical-align: middle;
display: table-cell;
color: #CCC ;
}

.spanImg {
width: 40px;
height: 40px;
margin-right: 8px;
}


The header tags have some CSS mark up as well.

Thanks just curious if this is bad practice or not for SEO header tags.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

2 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh106

Technically images are not headers and headers are designed for text based content, just a like a chapter in a book, however with this said, Google and other search engines will not give a ducking duck!

However, it seems that you would use this method because your using some code that you got elsewhere, or because you can't be bothered to adapt your current code. If you want to vertical-align then use a upper container to do so, for example:

<div class="example-container>
<img src="example.jpg" alt="example">
<h1>Example</h1>
</div>


Then use the vertical-align on the parent container, not the childs. You can use:

.example-container {
vertical-align: middle;
display: table-cell;
color: #CCC ;
}

.example-container img {
margin: 0 auto;
display: block;
}

.example-container h1 {
text-align: center;
}


Also, don't forget to make use of the ALT tag, as your example code does not, and that can help your SEO.

10% popularity Vote Up Vote Down


 

@Alves908

While this code may not cause harm, it is highly recommended that you do not put images or anything other than text into a hearer tag. The reason for this is simple. The header tag is an extremely important semantic clue for search engines. It is a content tag and not a format tag. For this reason, header tags should be textual content only. There is, for example, no reason to do this since you can have the image before the header tag.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme