Click here to Skip to main content
12,241,814 members (47,835 online)
Rate this:
 
Please Sign up or sign in to vote.
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 8:06am
Edited 6-Oct-12 8:08am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You Can use this Code too : 
<body style="background: url('image.jpg') no-repeat;"></body>
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100