Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am working on c# asp.net web pplication .net 4.5

i used this code to insert background image on webform.
HTML
<body background="image.jpg"> </body>

but the problem is that this image is repeated 5 to six time on page.

is there any possibilty to insert the image once on page???

thanks
Posted
Updated 6-Oct-12 7:08am
v2

HTML
You Can use this Code too : 
<body style="background: url('image.jpg') no-repeat;"></body>
 
Share this answer
 
Comments
[no name] 6-Oct-12 16:29pm    
thanks. it worked.
would you tell as well that how to specify image size ???
[no name] 6-Oct-12 16:51pm    
I have solved it, I just increased the actual size of image,
thanks
[no name] 6-Oct-12 17:08pm    
I did like this

<style type="text/css">
body
{
background-image:url('image.jpg');
background-repeat:no-repeat;
background-size: 100%;
}
Here is the trick
<style type="text/css">
body
{
background-image:url('image.jpg');
background-repeat:no;
}
</style>


You can also add the style in css instead of inline style.

Hope this helps.
cheers
 
Share this answer
 
v2
Comments
[no name] 6-Oct-12 17:08pm    
I did like this

<style type="text/css">
body
{
background-image:url('image.jpg');
background-repeat:no-repeat;
background-size: 100%;
}
</style>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900