HTML img repeat?

Tim

New Member
Hey everyone,

I want to know if theres a way to do:

*Example*
"background-repeat: repeat 90% 110%;"

On a html img

so it should be like this:

<img src="img/background2.png" width="500" height="500" id="bg" style="background-repeat: repeat 20% 20%;"/>

But that doesnt work.
I cant do it in the css because im using a Jquery that targets the html img and i dont know that much about jquery.

What i want to know is:
-Is this even possible if yes
-How can I solve it

Thanks for your help,
Tim
 

Pheno

New Member
No that would just be repeating the background of the image, rather than repeating the image. It's not possible to do what you want as far as I know.
 

lanmys

New Member
Hey everyone,

I want to know if theres a way to do:

*Example*
"background-repeat: repeat 90% 110%;"

On a html img

so it should be like this:

<img src="img/background2.png" width="500" height="500" id="bg" style="background-repeat: repeat 20% 20%;"/>

But that doesnt work.
I cant do it in the css because im using a Jquery that targets the html img and i dont know that much about jquery.

What i want to know is:
-Is this even possible if yes
-How can I solve it

Thanks for your help,
Tim

Try to make it like this "{
background-image:url('paper.gif');
background-repeat:repeat-20%;
}"
 

Tim

New Member
Okay, i diddnt fix the problem but i solved it. I just made a full size picture so i dont have to repeat it... To bad for the load time but w/e.

Now i have another problem. If i need to make a new tread for it just say it.

The problem is: The earth you see in the link below its in the middle. I tried bottem: 0px; but that doesnt work. It needs to be on relative to make it stay in the middle

http://www.vandevathorst.nl/tim/tb/thinkingbitsv3/
 

PixelPusher

Super Moderator
Staff member
First off, resorting to a large image and increasing your load time is a poor decision as web designer. In my opinion I would ditch the repeating image, before harming my page load time. Think if you loose your visitor due to page delay it doesn't matter what images are in your site. :confused:

I encourage you to find a alternate solution.

Now about images. The image element "<img />" should be used for content based images only. Meaning an image that adds to the contextual content of the page (i.e. picture of a house). Otherwise any image that is nothing more than styling (i.e. icons, gradients) should be applied through the css background property.


Moving on...

If you're using jquery and trying to make a "background" image repeat in element try something like this:
Code:
$('div.test').css({
   background: url() repeat [val] [val];
});
 
Top