Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All
I AHve Use Css In Asp.net Header background
but it is not shows after running website
CSS
#wrapper
{
    margin:0px;
    width:1080px;
    padding:10px;
    border:5px solid #exdeor;
    background-color:yellow;

}
#header
{
    height: 150px;
    border: 3px solid #dedede;
    background-image: url(image\phileli.gif);
    background-repeat: no-repeat;
    margin-top: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    margin-right: 0px;
    padding: inherit;
    width: 990px;
    height: 150px;
    position: relative;

    border-bottom: 2px solid #000000;
}
#contantarea
{
    float:left;
    width:750px;
    margin:20px 0 20px 0;
    padding:10px;
    border:3px solid #dedede;
}
#sidebaar
{
    float:none;
    float:right;
    width:250px;
    height:400px;
    margin:20px 10px 20px 10px;
    border: 3px solid #dedede;
    text-decoration:none;
    list-style:none;
}
#NAVIGATE
{
    height:35px;
    border:3px solid #dedede;
    background-image:url(image\button.png);
    }


XML
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body >
    <form id="form1" runat="server">
    <div  id="wrapper" >
    <div id="header">THIS IS MY HEADER
    </div>
    <div id="NAVIGATE"></div>
    <div id="contantarea">THIS IS BODY ARE AWHERE YOU MAY WRITE ANY THING THIS IS BODY
        ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY
        THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU
        MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY
        ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY
        THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU
        MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY
        ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY
        THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU
        MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY
        ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY
        THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU
        MAY WRITE ANY THINGTHIS IS BODY ARE AWHERE YOU MAY WRITE ANY THINGTHIS IS BODY
        ARE AWHERE YOU MAY WRITE ANY THING</div>
    <div id="sidebaar">
    <ul><li>HOME</li><li>HOME</li><li>HOME</li><li>HOME</li><li>HOME</li></ul>
    </div>
    </div>
    </form>
</body>
</html>
Posted

1 solution

If your image is shown when you are testing on your computer, but is not working on your website after you will publish on your web server, you have to make your Image sub-folder accessible to all users (that will access your website).

To do this you have to add the next settings in your web.config file:
XML
<location path="Image">
  <system.web>
     <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
</location>
 
Share this answer
 
Comments
irfanansari 31-Mar-14 6:32am    
at what place should past this code?
Raul Iloc 31-Mar-14 6:36am    
Inside the main root of your web.config, as child of "configuration" !
irfanansari 19-Apr-14 5:11am    
this is not working still same Error
irfanansari 23-Apr-14 15:26pm    
not working
Raul Iloc 24-Apr-14 3:35am    
Should work if your "Image" folder is a sub-folder of your web application root, otherwise you should change the path in the web.config setting above from": path="Image" to path="\someFolder\Image".

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900