asp.net - How to get this CSS Right? -


the more work css, more depression want set background picture stored on same folder aspx , cs files located, still wont put background picture:

/* defaults ----------------------------------------------------------*/  body    {     background-image:url(banner.gif);     display:block; // have tried without well, no change :( } 

default.aspx:

    <%@ master language="c#" autoeventwireup="true" codebehind="site.master.cs" inherits="webapplication1.sitemaster" %>  <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head runat="server">     <title></title>     <link href="~/styles/site.css" rel="stylesheet" type="text/css" />     <asp:contentplaceholder id="headcontent" runat="server">     </asp:contentplaceholder> </head> <body>     <form runat="server">              <asp:contentplaceholder id="maincontent" runat="server">              </asp:contentplaceholder>      </form> </body> </html> 

please how set background picture ?

you said css , image in same folder you've aspx file , css so

first try setting background color body say

body {    background: #f00; /*this should give red*/ } 

if works fine, wrong image path, if fail see color too, means stylesheet @ wrong path, instead of

<link href="~/styles/site.css" rel="stylesheet" type="text/css" /> 

should be

<link href="site.css" rel="stylesheet" type="text/css" /> 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -