Solved

CSS background image not displaying

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error on Add method 1 50
Not showing JavaScript in the list 5 52
HTTPS jquery doesn't work 9 58
Javascript to set controls visibility 5 32
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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 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

8 Experts available now in Live!

Get 1:1 Help Now