Solved

CSS background image not displaying

Posted on 2013-01-29
4
261 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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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