What's the correct way to hide the

tag and not be banned from Google?

前端 未结 10 1323
予麋鹿
予麋鹿 2021-02-07 00:54

The website I am working on uses an image defined in CSS as the main logo. The html code looks like this:

Something.com | The best something ever

10条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 01:08

    A full article in this matter is explained here https://www.paciellogroup.com/blog/2012/05/html5-accessibility-chops-hidden-and-aria-hidden/ So , when i work i use this code to support screen reader as well as hide some h1's and use pictures instead of it like (logo)

    .offscreen{
      position: absolute;
      clip: rect(1px 1px 1px 1px); /* for Internet Explorer */
      clip: rect(1px, 1px, 1px, 1px);
      padding: 0;
      border: 0;
      height: 1px;
      width: 1px;
      overflow: hidden;
    }
    

    to find more follow the link

提交回复
热议问题