No background color

Dear All,
Below is my simple code both my .css and .html. The problem in Firefox the div have the background color but not in IE so what is the problem ya?

* {
	padding:0px;
	margin:0px;
}
body
{
	background:#ffffff;
	font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
	font-size:small;
	'margin:8px 0 16px;
	margin: 0;
	padding:0;

	
}


#nav 
{
	background-color:#ccc;
	height:39px;
	width:1000px;
	align:center;
}
<html>
<head>
  <link rel="stylesheet" type="text/css" href="my.css" media="all">	 
</head>
<body>



<div id=nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>


</body>
</html>

Dear Kalon,
Below is both my .css and .html. So now all the links appear but all just side by side how to space them to be seen equal and clean. Secondly how to change the color of the font to become black. I have put the black is not appearing either.

  • {
    padding:0px;
    margin:0px;
    }
    body
    {
    background:#ffffff;
    font-family:“Lucida Grande”, Tahoma, Arial, Verdana, sans-serif;
    font-size:small;
    margin:8px 0 16px;
    margin: 0;
    padding:0;

}

#nav
{
background-color:#ccc;
height:39px;
width:1000px;
font-family:Calibri;
}
#nav li {
float: left; position: relative;
}

#nav a {
font: Calibri, black sans-serif 12px; text-decoration:none;
}

<html>
<head>
<link rel=“stylesheet” type=“text/css” href=“my.css” media=“all”>
</head>
<body>

<div id=logo>
<img src=“images/logo.jpg”>
TEST

TEST 2
</div>

<div id=‘nav’>
<ul>
<li><a href=“”>test</li>
<li><a href=“”>test</li>
<li><a href=“”>test</li>
</ul>
</div>

</body>
</html>

Dear All,
I have div as below. Now the problem the text “TITLE” and “DETAILS” as just beside the image and below it. I want the TITLE to be in the center and DETAILS to be at right corner. So how can I space it well and clean. I know &nbsp but that is not a clean method too clumsy. Any other please?

<div id=logo>
<img src=“images/logo.jpg”>
TITLE
DETAILS
</div>

Dear Kalon,
Ok I wrote it by myself and offcourse I saw from some other link and add and trying it by myself but unfortunately got stuck here and there. Ok I will try now.

I’m a little confused now.

Did you write the code you posted or did you copy and paste it from somewhere and now want someone to fix it.

The reason I ask is because I assume you gave the div an id (nav) and set its styles in your css and what I suggested for your link is much the same process.

Give the link an id and then set the color and text-decoration styles, as I suggested, just as you set the nav div styles earlier.

when I put the css in my previous post in a separate css file and link to it using


<link rel="stylesheet" type="text/css" href="my.css" media="all">

it still works in my IE8

Make sure the href in your link has the correct path to your css file.

Dear Kalon,
Yes it works now. My next question I have put something like this. The Home font color is blue and have a link line how to make it black with out any link line below it.
<div id=‘nav’>
<table>
<tr>
<td>
<a href=“”>Home</a>
</td>
</tr>
</table>
</div>

if it’s just that link, you can give it an id and then set the color style to whatever color you want and text-decoration: none;

Dear Kalon,
Any example how to do it please? Thank you.

Dear Kalon,
Yes like this it works. I am using IE 7 but why when I call via .css it doesnt not work. Thank you.

I get a grey-ish background colour in IE8 with

 
<html> 
<head> 
<style type="text/css">
* { 
padding:0px; 
margin:0px; 
} 
body 
{ 
background:#ffffff; 
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; 
font-size:small; 
margin:8px 0 16px; 
margin: 0; 
padding:0; 

} 

#nav 
{ 
background-color:#ccc; 
height:39px; 
width:1000px; 
} 
</style>
</head> 
<body> 
 
<div id='nav'> 
<ul> 
<li><a href="#">Home</a></li> 
<li><a href="#">Products</a></li> 
<li><a href="#">Services</a></li> 
<li><a href="#">About</a></li> 
<li><a href="#">Contact</a></li> 
</ul> 
</div> 

</body> 
</html> 

what version of IE are you using?

try changing

 
<div id=nav>

to

 
<div id=[COLOR=red]'[/COLOR]nav[COLOR=red]'[/COLOR]>

Dear Kalon,
Same still IE not showing it but no problem in firefox. Thank you.