skip to Main Content

I will be creating a fixed navigation for my website and in their will be a logo that contains the company name along with some icon. Since the company name is in the logo itself it seems pointless to use an header tag in my HTML. But I want search engines to see my company name in my h1 tag for seo purposes. Would using the css property value display:none; on the h1 element be a solution to this?

3

Answers


  1. I’d suggest to have the image as a background-image of h1. You can still add text but you can style it with font-size: 0 or use a negative text-indent to hide your text.

    Login or Signup to reply.
  2. alt attribute of img is exactly for that: describing content of image to bots, screen readers etc.

    Google explicitly says that they are using it when parsing websites:

    As the Googlebot does not see the images directly, we generally
    concentrate on the information provided in the “alt” attribute.

    Login or Signup to reply.
  3. You can use this construction:

    <h1>
      <img src="logo.png" alt="My company name">
    </h1>
    

    Alt text acts as the content of the h1.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search