...

View Full Version : Repeating a non-background image



dtpeutaw
07-31-2012, 10:43 PM
I am using an image that I would like to repeat 100% horizontally. I would also like to link to another page when someone clicks the image.

I am able to see the image and also link to another page when the image is clicked but the image does not repeat.

I tried styling the image with repeat-x and I also used the image as the background image of the border div, but nothing worked.

If anyone can help me with this, I am grateful.

html code is

<div id="border">
<a href="index.html"><img src="images/border.png" /></a>
</div>

css code is

border{
margin: 0;
padding: 0;
height: 200px;
}

tempz
07-31-2012, 10:50 PM
<div id="border">
<a href="index.html">My text</a>
</div>

css code is


border {
margin: 0;
padding: 0;
height: 200px;
}
border a {
margin: 0;
background:url('/images/border.png') repeat-x;
padding: 0;
height: 200px;
}


or


<div id="border">
<a href="index.html"><img src="images/border.png"></a>
</div>

css code is


border img {
background-repeat:repeat-x;
}

dtpeutaw
07-31-2012, 11:47 PM
Thank you for responding. I tried both of these and neither gave me a repeating image. However, I am able to get the image once.

VIPStephan
08-01-2012, 12:10 AM
Thank you for responding. I tried both of these and neither gave me a repeating image.

That is because tempz forgot to put the hash (#) in front of the ID selector:


#border {


dtpeutaw
08-01-2012, 02:29 AM
Thank you VIPStephan and tempz. I was able to get the border to repeat or display once with a link, but was not able to get it to repeat and to link. I want to be able to link to another page from the repeated border.

DrDOS
08-01-2012, 02:42 AM
Thank you VIPStephan and tempz. I was able to get the border to repeat or display once with a link, but was not able to get it to repeat and to link. I want to be able to link to another page from the repeated border.
Because the image is being used as a background image, you will have to put your link in or on whatever it is the background for.

dtpeutaw
08-02-2012, 02:04 AM
Thank you so much DrDos, VIPStephan, and tempz. It is working. Again, thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum