0

hi! ;)

I just want to asked on how I can set the image as background.

I put an image on the working station but once I run it, it doesn't appear on the browser. thanks.

I'm using Visual Studio 2008 ;)

4
Contributors
7
Replies
17
Views
6 Years
Discussion Span
Last Post by diafol
0

Hi!

I presume that your image is stored inside Images folder under root of your web-app.

Code your web-page

<head runat="server">
  <style type="text/css">
       .sample
        {
          background:url(Images/image1.jpg);
         }
  </style>
</head>

<body>
  <div class="sample">
      <h1>Sample Text</h1>
  </div>
</body>
0

hello sir :)

thank you for your reply :D

but the image is still not appearing in the browser.

here's the code that I made.

<html>
<head runat="server">
    <style type="text/css">
        .sample
        {
        	background:url(~/App_Data/s2.jpg);
        	}
    </style>
    <title>Lupon</title>
</head>
<body>

    <form id="form1" runat="server">
    <div class="sample">
    </div>

    </form>
</body>

Edited by kgenn: n/a

0

Do not place images inside the special folder like App_Data, App_code etc. Create a folder named Images under your root and move all image files into it.

I presume following structure,

Webapp/
      |----------------\Images
      |                  |s2.jpg
      |sample.aspx
<html>
<head runat="server">
    <style type="text/css">
        .sample
        {
        	background:url(Images/s2.jpg);
                height:300px;
                width:300px;
          }
    </style>
    <title>Lupon</title>
</head>
<body>

    <form id="form1" runat="server">
    <div class="sample">
         
    </div>

    </form>
</body>
0

Thank you very very very very mucchh sir :)

it works :)

very much thank you. :)

now I can move to the next project :)

thank you sir :)

God bless :)

thanks! :D

1

Use cover.

Votes + Comments
Good answer in any war zone.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.