Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 126645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:21:02+00:00 2026-05-11T05:21:02+00:00

I am using the text-indent technique to replace my <h1/> tag with my website’s

  • 0

I am using the text-indent technique to replace my <h1/> tag with my website’s image as so:

<h1 title='Homepage'>My logo</h1> 

CSS:

#header h1 {     float: left;     background: transparent url('../images/logo.png');     width: 214px;     height: 64px;     text-indent: -9999px; } 

The only problem is that I want to still have the new image act as a hyperlink. I tried doing:

<h1 title='Homepage'><a href='#'>My logo</a></h1> 

But since it is being indented, the link is too. I wanted to know if anyone had any suggestions on how to do this and still be valid XHTML.

EDIT I’d rather do it in a way that is accessible to users with screen readers, from what I read, doing a display:none will not work with some readers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:21:03+00:00Added an answer on May 11, 2026 at 5:21 am

    There are many ways to do this, this is the way that I prefer, it works well, and is easy to implement.

    <div id='header'>     <h1><a href='/' title='Homepage'>Homepage</a></h1> </div> 

    Then i do this css, this is also know as the ‘Leafy/Langridge image replacement’ method

    #header h1 a {     display: block;     padding: 22px 0 0 0;     overflow: hidden;     background-image: url(../images/sidebar/heading.png);     background-repeat: no-repeat;     height: 0px !important;     height /**/:22px; } 

    The only thing you should have to edit is the height, and the padding-top. In this example it is 22px, this should be equal to your image-height.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the negative-text-indent technique I learned to show a text-image to the
I have an image that replaces an tag <h1 id=myImage>Text</h1> The css looks something
I am using a background image to replace the text of a link using
When we use Text Replacement using CSS and give a negative test-indent i.e. text-indent:-9999px
I want to use a technique like text-indent:-9999em or negative margin to replace my
I'm having an issue using the empty span css image replacement technique in IE
I always use the technique of making css buttons with a text-indent of -9999px
Is it possible to text indent each line in a textarea? I'm using a
I have am using an image button instead of text for a submit button
I'm trying to create a simple image navigation for my site, using CSS to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.