Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I have written the following code in .cs file:
XML
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="Stylesheets/OEIS_v1.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="HeaderGraphic"></div>
        <div id="NavigationArea">| link1 | link2 | link3 | link3 |</div>
        <div id="BodyArea">
            <div id="BodyLeft">Left Text</div>
            <div id="BodyRight">Right Text</div>
        </div>
        <div id="FooterArea">© 2011 - 2012: SSB</div>
    </div>
    </form>
</body>
</html>


I have created the .css file as:
CSS
body
{
    padding-right: 1%;
    padding-left: 1%;
    padding-bottom: 1%;
    margin: 0%;
    padding-top: 1%;
    height: 98%;
    background-color: #f8fec8;
    text-align: center;
}
#HeaderGraphic
{
    background-image: url(Images/HeaderImg.JPG);
    width: 697px;
    height: 152px;
    float: none;
    clear: both;
}


Now when I am executing the application I cannot see the image though that much space is shown blank.

Can anyone suggest a reason and its resolution.

Thanking you in advance.

regards,
Indrajeet
Posted

Can't be certain but try something like (depending on the relative location of the images folder):

CSS
background-image: url('../Images/HeaderImg.JPG');
 
Share this answer
 
Comments
Indrojeet_Bhattacharya 5-Jan-12 13:38pm    
wow thanks Mark! it worked ... thanks a lot. I am new to web designing so need quiet a bit of help.
Sergey Alexandrovich Kryukov 5-Jan-12 18:56pm    
Ha-ha! As simple as that. -- My 5.
--SA
try
C#
background-image: url('/Images/HeaderImg.JPG');

or


C#
background-image: url('../Images/HeaderImg.JPG');



or

put image in root directory and

C#
background-image: url('HeaderImg.JPG');
 
Share this answer
 

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