Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NET
i am working on c# asp.net web pplication .net 4.5
 
i used this code to insert background image on webform.
<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 6 Oct '12 - 7:06
Edited 6 Oct '12 - 7:08


2 solutions

You Can use this Code too : 
<body style="background: url('image.jpg') no-repeat;"></body>
  Permalink  
Comments
safora khan - 6 Oct '12 - 16:29
thanks. it worked. would you tell as well that how to specify image size ???
safora khan - 6 Oct '12 - 16:51
I have solved it, I just increased the actual size of image, thanks
safora khan - 6 Oct '12 - 17:08
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
  Permalink  
Comments
safora khan - 6 Oct '12 - 17:08
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 424
1 Mahesh Bailwal 398
2 Maciej Los 205
3 Aarti Meswania 173
4 Rohan Leuva 165
0 Sergey Alexandrovich Kryukov 9,417
1 OriginalGriff 7,204
2 CPallini 3,933
3 Rohan Leuva 3,211
4 Maciej Los 2,743


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid