Jump to content

Linking From A Background Image In Css


Recommended Posts

Hello everyone,I am brand new to this, as may already be evident from the wording of my thread title. After some reading and practice, I am fairly confident on the basics of CSS and XHTML, and I am wanting to push myself a little. In the website I am creating for my own practice sake, I have an external CSS page which is working satisfactorily for basic things around the website. Now I'd like to see if I can make certain sections of the background image to be links to other pages, instead of the HTML navbar I have created. So if I want different sections or elements of the background image to link to other pages on the website, is there a way to do this? If this is written into external CSS, then it should be the same site-wide, correct? Perhaps I am biting off more than is helpful for me to chew at the moment. Any suggestions/corrections are welcome.Thank you for your time. It is much appreciated.

Link to post
Share on other sites

A background image doesn't link to anything. An HTML element does. You need the HTML <a> element if you want to link to somewhere. What you can do is have several <a> elements. Use CSS to show only a portion of the background image on each link. Another alternative is to use image maps

  • Like 1
Link to post
Share on other sites

Cheers. The image maps look interesting, I'll look into that.

Use CSS to show only a portion of the background image on each link.
Does this mean I can program sections of the background image to disappear/appear on mouse roll over, or do you mean, using CSS, each page would have only certain portions of the background image visible ? or both, or am I misunderstanding completely?
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...