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 9256795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:02:50+00:00 2026-06-18T12:02:50+00:00

I am looking to add a link to an image in a CSS style

  • 0

I am looking to add a link to an image in a CSS style sheet so it will navigate to the link when the image is pressed.

The code for the image itself is:

 #logo{
    background-image: url(images/logo.png);
    width: 981px;
    height: 180px;
    margin-left: auto;
    margin-right: auto;

What is the code to add to allow it to navigate to a hyperlink? For example: If I wanted it to navigate to http://home.com

  • 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. Editorial Team
    Editorial Team
    2026-06-18T12:02:52+00:00Added an answer on June 18, 2026 at 12:02 pm

    You can not do that…

    via css the URL you put on the background-image is just for the image.

    Via HTML you have to add the href for your hyperlink in this way:

    <a href="http://home.com" id="logo">Your logo</a>
    

    With text-indent and some other css you can adjust your a element to show just the image and clicking on it you will go to your link.


    EDIT:

    I’m here again to show you and explain why my solution is much better:

    <a href="http://home.com" id="logo">Your logo name</a>
    

    This block of HTML is SEO friendly because you have some text inside your link!

    How to style it with css:

    #logo {
      background-image: url(images/logo.png);
      display: block;
      margin: 0 auto;
      text-indent: -9999px;
      width: 981px;
      height: 180px;
    }
    

    Then if you don’t care about SEO good to choose the other answer.

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

Sidebar

Related Questions

I am looking for a plugin that will popup a full size image WITH
I'm looking for an application using a middleware that would automatically add a link
I am trying to add an HTML link with an image as the anchor,
I'm looking to add a _ _ in the Array variable for each of
I am looking to add functionality to my website where users can add an
I am looking to add a local database file (.sdf) into my .NET Project.
I'm looking to add double buffering to a drawing function like this. dc =
I'm looking to add transactional support to my DB engine and providing to Abstract
I'm looking to add a textbox on my website that captures a single email
I am looking to add the Google Map API to my own website, but

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.