Solved

CSS background image not displaying

Posted on 2013-01-29
4
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 500 total points
ID: 38833511
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
ID: 38833839
Thank you.  That fixed it.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 38834057
Then please mark my answer as the solution and close the question.  Cheers
0
 

Author Closing Comment

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

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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