billydocks Posted September 26, 2011 Share Posted September 26, 2011 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 comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 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 Link to comment Share on other sites More sharing options...
billydocks Posted September 27, 2011 Author Share Posted September 27, 2011 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 comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 If an element is smaller than the background image, then only part of the image will show. You can choose which part by using background-position. This is used in a technique called image sprites. Link to comment Share on other sites More sharing options...
billydocks Posted September 27, 2011 Author Share Posted September 27, 2011 Great. This gives me plenty to look into and play around with. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.