Replace text with an image using CSS

css_logo

A quick little way to do this (whilst still degrading and being kind to screen readers)

h1 {
text-indent:-9999px;
background:url("heading.jpg") no-repeat;
width:100px;
height:50px;

How it works: text-indent:-9999px; relocates the text title off screen, replacing it by an image declared by background: {…} utilising a fixed width and height.

Leave a Reply

Your email address will not be published. Required fields are marked *