-1

I am trying to get a correct page structure by defining my h1, h2's and so on correctly. But I have an image with a slogan, with text that should actually be a h2.

What would be a correct way to not show text in the h2, to show the slogan, and still have a correct page structure, also for i.e. SEO and for readability?

Stefan Schouten
  • 249
  • 2
  • 13
  • Some browsers refuse to honour `font-size` definitions that are too small, and may clamp you to `font-size:8pt` instead. This will not work the way you want. – Niet the Dark Absol Oct 20 '16 at 11:07
  • if you want to use slogan with image but want to hide then use alt tag of image. – Leo the lion Oct 20 '16 at 11:16
  • @Paulie_D isn't it so that the guidelines of the SEO, for multiple search engines, are getting clearer over time? If so, I don't see why this is too broad or opinion based. – Stefan Schouten Oct 20 '16 at 11:21
  • @Paulie_D also, forgive my ignorance, but this is a question about HTML usage - does that have anything to do with the ProWebmasters exchange? I thought, because this is about coding, that this belonged here. – Stefan Schouten Oct 20 '16 at 11:23
  • @Leo the lion Thanks, I tend to forget about the alt tag. – Stefan Schouten Oct 20 '16 at 11:24
  • @Paulie_D Thank you. I still see this as a gray area, being a little of both, but I also realize that that's probably just my opinion. I will keep this in mind for the future. – Stefan Schouten Oct 20 '16 at 11:30
  • Thank you for your inputs. I have edited my post for a clearer question. – Stefan Schouten Oct 20 '16 at 11:36
  • 2
    "Best Way" is **still** opinion based. – Paulie_D Oct 20 '16 at 11:42
  • Can anyone tell me why i got downvote?? – Leo the lion Oct 20 '16 at 11:45
  • How is "best way" opinion based if it would be possible to measure it? Font-size: 0px is a worse way than an alt tag because it's bad for accessibility, apparently. It's *not* an opinion. That's the kind of answer I am looking for. – Stefan Schouten Oct 20 '16 at 11:49
  • @StefanSchouten means you are saying using alt tag is worse?? – Leo the lion Oct 20 '16 at 11:51
  • No, I'm saying that the 0px font size, as I used as an example before editing my question, is worse than your idea. Your idea might actually be the answer, but I'm waiting for someone else to share their knowledge. – Stefan Schouten Oct 20 '16 at 11:53
  • ohh ok then. I have used that way and read in a lot blog but hope to get more knowledge :) – Leo the lion Oct 20 '16 at 11:57
  • @Paulie_D I feel like you're just nitpicking based on my previous word choice. I just don't see why people agree with you (based on upvotes on your comments), while at the same time [this question](http://stackoverflow.com/questions/665037/replacing-h1-text-with-a-logo-image-best-method-for-seo-and-accessibility?rq=1) uses "best way" and "SEO" in the title, where no one bats an eye. – Stefan Schouten Oct 20 '16 at 11:58
  • That question was from **2009** when Stack Overlfows rules were **very** different. – Paulie_D Oct 20 '16 at 12:02
  • @Paulie_D Fixed it. If there's more of incorrect SO usage in this question, you're more than welcome to open a web chat. – Stefan Schouten Oct 20 '16 at 12:13

1 Answers1

-1

If you want to show image text and considering the SEO then alt tag will be best for this. Yes h2 tag as effect on SEO but as well as alt tag too.

you can use it like this

<img src="#" alt="cartoon">

Here i considering cartoon word so i type like this one and it will be valid for SEO and have similar effect as h2. other thing is you can make image name as same as target keyword.

<img src="cartoon.jpg" alt="cartoon" name="cartoon">

You can see in above example, add name tag too so it will have good SEO effect without using h2 tag. hope this will help.

Leo the lion
  • 3,213
  • 2
  • 19
  • 39