Forum Moderators: not2easy
So the code on the html page reads: <link rel="stylesheet" type="text/css" href="css/background.css"/>
The code inside this file reads:
<!--
body { background-image: url(http://www.mywebsite.com/images/main-image.jpg); background-repeat: no-repeat; background-position: center top}
-->
I'm happy with everything, now I just need to make this background image linkable. I would like for people to click on this background image and have them go to the homepage, "mywebsite.com." How can I do this? Also, because this is a background image, it doesn't come out in print outs like all of the other images. Is there a way for a background image to show up in print outs?
you cannot, as such, make a background-image a link.
In your case, though, this could be achieved by placing the a element over the background-image as in this example....
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
body {
background-image:url(http://www.searchengineworld.com/gfx/logo.png);
background-repeat:no-repeat;
background-position:center top;
margin-top:0;
}
#link {
width:109px; /*this width will be equal to the background image width*/
height:56px; /*this height will be equal to the background image height*/
margin:auto;
}
#link a {
width:100%;
height:100%;
display:block;
}
</style></head>
<body><div id="link">
<a href="http://www.webmasterworld.com/css/3576144.htm"></a>
</div></body>
</html>
birdbrain
Is there a way for a background image to show up in print outs?
You cannot force users to print images.
That will always remain there choice as they have to pay for the ink. ;)
Of course,if you want to print them, then you must set your options to print them.
IE procedure...
No problem, you're welcome. ;)