|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
background
whats wrong with this?
body { font-family:arial; font-color:#000000; background:url(background/bg.jpg); } its the background bit that isnt working it works when the css is included on the page but when i put it on a seperate stylesheet it hasnt worked |
|
#2
|
|||
|
|||
|
i also tried background-image
|
|
#3
|
|||
|
|||
|
There is no font-color property in CSS. Use color. As for your background, you must use quotes in a URL like so: background: url("background/bg.jpg");
|
|
#4
|
|||
|
|||
|
its still not worked....this is the 1st time ive tried using a stylesheet
heres what i have on my page Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
<title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="sinergy.css">
</head>
<body> <div align="center">
<table cellpadding="0" cellspacing="0">
<tr>
<td height="100" colspan="3" style="background: url('background/logo-mergew.jpg');"></td>
</tr>
<tr>
<td width="100" height="15" style="background: url('background/row_divider.jpg');"></td>
<td width="15" height="15" style="background: url('background/join.jpg');"> </td>
<td width="541" height="15" style="background: url('background/row_divider.jpg');"> </td>
</tr>
<tr>
<td width="100" height="285" valign="top" style="background: url('background/left.jpg');">
<div align="center"> <a href="index.html">Home</a> <br />
<a href="news.php">News</a> <br />
<a href="templates.html">Templates</a> <br />
<a href="graphics.html">Graphics</a> <br />
<a href="scripts.html">Scripts</a> <br />
<a href="contact.html">Contact </a><br/>
</div></td>
<td width="15" style="background: url('background/column_divider.jpg');"></td>
<td valign="top" bgcolor="#BCD2FE">
<p>Here is a list of links to sites i think may be useful </td>
</tr>
</table>
<br />
<br />
<a href="map.html">Site Map</a> .:. <a href="tou.html">Terms</a>
<h1>Animations Images backgrounds free web Graphics <br />
webpage Templates website Scripts</h1>
</div>
</body>
</html>
and heres what i have on my stylesheet... Code:
.sinergy
body
{
font-family:arial;
font-color:#000000;
background: url("background/bg.jpg");
}
table
{
border:none;
width: 650px;
font-family: Arial, Helvetica, verdana;
}
a:link
{
color:#ffffff;
text-decoration:none;
font-weight: bold;
}
a:visited
{
color:#ffffff;
text-decoration:none;
font-weight: bold;
}
a:hover
{
color:#ffffff;
text-decoration:none;
font-weight: bold;
background-color:#4E5CDE;
}
h1 {
font-weight: bold;
color: #0099cc;
font-size: 12pt;
line-height: 14pt;
font-family: helvetica;
font-variant: normal;
font-style: normal;
}
can you see anything wrong with that? other than the font-color ? |
|
#5
|
||||
|
||||
|
Actually, you don't NEED the quotes, it's just good form. The url inside is relative though, so if you have your css in a different folder than your html, you'll be referencing the wrong place. Make sure that bg.jpg is in the folder "background," and that the "background" folder is in the same directory as your css. A good way to do this is to place all your html and css in the same--I use the main--directory, and build all subdirectories from there.
Hope that helps. -- edit -- after looking at your code, I see the problem: Code:
.sinergy is floating off by itsself. This is an empty CSS class, and should have { and } after it: Code:
.sinergy{}
That should make your page render correctly.
__________________
Proud member of the T.S.N.B.U.F.L (tables should not be used for layout) alliance. "Only use elements for their intended purpose. You wouldn't try to make coffee with a telephone, would you?" -Me Last edited by TheJim01 : July 26th, 2004 at 02:39 PM. |
|
#6
|
||||
|
||||
|
Quote:
Check the external file for html tags and html comments. These are no-nos, and are common gotchas. [edit]Looks like Jim called the shot while I was refilling the mug and typing.[/edit] cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. Last edited by kk5st : July 26th, 2004 at 02:45 PM. |
|
#7
|
|||
|
|||
|
thejim, the () sorted it out,
thanks for that ![]() |
|
#8
|
||||
|
||||
|
Quote:
yeah, he beat me too, so i didn't post my reply ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > background |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|