Blog

Hiding H1 Text for Logo

I first noticed this technique being implemented on the old Digg layout. You can setup an H1 tag which also has your website’s name in plaintext for SEO purposes. But using CSS we can move this text so it isn’t visible, and replace it with a custom logo image.

Hiding H1 Text for Logo

  1. h1 {
  2.     text-indent: -9999px;
  3.     margin: 0 auto;
  4.     width: 320px;
  5.     height: 85px;
  6.     background: transparent url(“images/logo.png”) no-repeat scroll;
  7. }

Got Something To Say: