7 Replies - 12852 Views - Last Post: 06 October 2012 - 02:27 PM Rate Topic: -----

#1 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

adding background image in asp.net

Posted 06 October 2012 - 10:09 AM

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
Is This A Good Question/Topic? 0
  • +

Replies To: adding background image in asp.net

#2 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,174
  • Joined: 02-July 08

Re: adding background image in asp.net

Posted 06 October 2012 - 11:25 AM

In css use or style:

.ImageBG
{ 
background-image: url('path to image');
background-repeat: no-repeat;
background-position: right center;
}

This post has been edited by _HAWK_: 06 October 2012 - 11:27 AM

Was This Post Helpful? 0
  • +
  • -

#3 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: adding background image in asp.net

Posted 06 October 2012 - 01:34 PM

View Post_HAWK_, on 06 October 2012 - 11:25 AM, said:

In css use or style:

.ImageBG
{ 
background-image: url('path to image');
background-repeat: no-repeat;
background-position: right center;
}



thanks. it worked.
would you tell as well that how to specify image size ???
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,174
  • Joined: 02-July 08

Re: adding background image in asp.net

Posted 06 October 2012 - 01:41 PM

Did you try the background-size: 100%; in the same css class as above?

Edit: that is a css3 property. I'll look for an equivalent. Poss Solution

This post has been edited by _HAWK_: 06 October 2012 - 01:52 PM

Was This Post Helpful? 0
  • +
  • -

#5 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: adding background image in asp.net

Posted 06 October 2012 - 01:50 PM

View Post_HAWK_, on 06 October 2012 - 01:41 PM, said:

Did you try the background-size: 100%; in the same css class as above?


yes I did, but its still representing very small size.

View PostSabra khan, on 06 October 2012 - 01:46 PM, said:

View Post_HAWK_, on 06 October 2012 - 01:41 PM, said:

Did you try the background-size: 100%; in the same css class as above?


yes I did, but its still representing very small size.


I have solved it, I just increased the actual size of image,
thanks for your precious time.
Was This Post Helpful? 0
  • +
  • -

#6 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,174
  • Joined: 02-July 08

Re: adding background image in asp.net

Posted 06 October 2012 - 01:55 PM

That was a choice, did you see my updated link?
Was This Post Helpful? 0
  • +
  • -

#7 Sabra khan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-August 12

Re: adding background image in asp.net

Posted 06 October 2012 - 02:12 PM

View Post_HAWK_, on 06 October 2012 - 01:55 PM, said:

That was a choice, did you see my updated link?


No what is it ??????
Was This Post Helpful? 0
  • +
  • -

#8 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,174
  • Joined: 02-July 08

Re: adding background image in asp.net

Posted 06 October 2012 - 02:27 PM

Post#4
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1