Forum Moderators: not2easy

Message Too Old, No Replies

CSS and background problems!

So frustrating!

         

marsh

6:28 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



I have a basic CSS set up, which works ok except that the browser (IE) doesn't change the background color of the div's. Here is the set up:

CSS-
.nav { background-color: #CCFFFF; float: right; position: fixed; width: 250px;
top-margin: 120px; right-margin: 5px; height: 500px; display: inline;
}

.top { background-color: #CCFFFF; position: fixed; width: 900px; text-align: right;
margin-top: 0px; color: black; left-margin: 200px; border-top-style: groove;
}

HTML-

<html 4.0>
<head>
<title>title</title>
<link rel="stylesheet" type="text/css href="style.css">
</head>
<body bgcolor="#CCCC99">
<p><img src="new_efi_logo.gif" align="left"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><br>
</p>
<div class="top"><font align="right">Home¦Who we Are¦How to get here</div><br>
<table background="bulbback.jpg" width="800px" height="500" align="left">
<!--DWLayoutTable-->
<tr>
<td width="750px" height="500" valign="top">Energy Federation, Your home
for all energy efficient Products.</td>

</table>

<div class="nav"><h4>Products:</h4><br><br>
Lighting<br>
Water<br>
Ventalation<br>
Solar<br></div>

Can someone help me out with this?

Reflection

7:01 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



Not sure why you are having a problem with the background(it works fine if you stick that css in the head of your document) but there are many other problems you will want to address.

First you need to pick a valid doctype [w3.org].

Second you should ask yourself why you are using each css property. There is no such property as right-margin, top-margin etc. Its margin-right, margin-left etc. Also you are using position:fixed; and display:inline; for no reason.

Third, if you are using css there is no reason to use a font tag, <font align=right> can be replaced with text-align:right; in your div.

Anyway hope that helps a bit.

katana_one

7:03 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



I'm not sure I understand the problem: I see a page with a tan background overall and light blue backgrunds for the "top" and "nav" divs. I am using IE 6 on a Windows 98 box.

Noisehag

7:07 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



<link rel="stylesheet" type="text/css href="style.css">

Is this file contained in the same directory as your html page? Stupid question I know, but sometimes the obvious...

marsh

7:42 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



Well first off, I am just playing around with it, it is not a real site. I am fairly new to CSS and am trying to get a feel for it. For some reason though I can't see the colors on the top and nav portions of my page when viewed locally (using win xp and ie6). The CSS file is in the same directory with the rest of the files. Maybe it's just my machine? I haven't declared a Doctype cause this will probably never go live. And to address the <font> tags I only wrote the stylesheet for the nav and top for right now. Well thanks for your help!