Forum Moderators: not2easy
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>example</title>
<link rel="stylesheet" href="../stylesheet/example2.css">
</head>
<body>
<div id="myid" >
<p class="class2">this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
<p>this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
</div>
<hr/>
<div>
<p class="myclass2">this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
<p>this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
</div>
<hr/>
<p class="myclass">this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
<p>this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
<p>this is the best thign ever. Cant you see the lever. If you swtich it you will die , so put on a smile and say goodbye.</p>
<p><span>fdsfsdfsdfsdfsdfsdf</span></p>
<p>sdfgdsfgdsgfdssdg</p>
<p><span>exactly 10 P elements</span></p>
</body>
</html> Right now when I look at my html file all I see is a whole background the first div(the myid one) covered with a read background.
It does not work when I just import it to the linked style sheet which indirectly connects it to the html document
The div#myid rule works when...
And what I meant was I see a white background with a red color filled div.(thats it, no blue or green) Like you said only the first div is colored red. I must have worded it wrong.
* {
font-style: italic;
background-color: blue ;
} <html><head>
<title>@Import Example</title>
<link rel="stylesheet" href="styles/linked.css">
</head>
<body>
<p>1. This should be red.</p>
<p class="green">2. This should be green.</p>
<p class="blue">3. This should be blue.</p>
</body>
</html>
@import url(imported.css);
/* All paragraphs are red by default */
p {
background-color: red;
}
@import url(imported-nested.css);
/* Override the default red */
p.green {
background-color: green;
}
/* Override the default red */
p.blue {
background-color: blue;
}
I took out the @import url rule in my linked CSS file and the blue shows up in my dreamweaver view now but still not in my browsers.(IE , Chrome and FF)
I expect to see a div in red.As penders has explained, you won't see that in your original styles because the <p>'s are blue so you will only see the red div background in the margin area of the <p>. As penders has suggested, clear the browser cache (set your test browsers to "check each page load"), validate the css files to check for errors, and (this makes no sense, I know) make a new file - wouldn't be the first time some invisible oddity caused a css file to fail.