Solved

CSS background image not displaying

Posted on 2013-01-29
4
246 Views
Last Modified: 2013-01-30
I am trying to convert a classic ASP website into ASP.NET.  I want to use Master Pages so I started to create the Master Page with the elements that will appear on every page.  The problem I am having is that the background image in my CSS is not displaying as expected.  I am including  a code sample of a test.aspx page that I am using just to get header working.

Here is the relevant CSS that is included in my Styles/styles.css file

/* CSS Document */

/* CSS common to all pages - layout */
* {
  margin: 0;
}
html, body {height:100%}
body {
	padding:0;
	margin:0;
	background-color: #006699;
	color: #000000;
	font: 14px "Trebuchet MS", Verdana, sans-serif;
}
#outer{
	min-height:100%;
	min-width: 800px;
	margin-left:175px;
	margin-right:155px;
	background-color: #dee4fe;
	border-left:15px solid #ffd666;
	margin-bottom:-52px;
	color: #000000;
}
* html #outer{height:100%;} /* IE6 and under treat height as min-height anyway*/
#header{
	background:#ffd666;
	border-bottom:15px solid #ffd666;
	color: #000;
	text-align:left;
	position:relative;
	margin-bottom: 0;
	margin-left: 0px;
	margin-right: -154px;
	margin-top: 0;
	min-height:0;/* ie 7 haslayout fix */
	background-image:url(images/background.jpg);
	background-repeat:repeat;
}

Open in new window


Here is the page layout:

<!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></title>
    <link href="Styles/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="outer"> 
        <div id="header"><p>this is the header</p></div>
    </div>
    </form>
</body>

Open in new window


Any help with this will be appreciated!  I just need to know what I am doing wrong that the background is not showing up.
background.jpg
0
Comment
Question by:dyarosh
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
tedbilly earned 500 total points
Comment Utility
Are you aware that the URL reference is relative to the CSS file, not the document itself?  I have a feeling that is the issue.
0
 

Author Comment

by:dyarosh
Comment Utility
Thank you.  That fixed it.
0
 
LVL 51

Expert Comment

by:tedbilly
Comment Utility
Then please mark my answer as the solution and close the question.  Cheers
0
 

Author Closing Comment

by:dyarosh
Comment Utility
Sorry about that.  Battling a sinus infection and my mind isn't working :)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now