First CSS rule of a linked stylesheet is ignored

VERIFIED DUPLICATE of bug 149466

Status

()

Core
CSS Parsing and Computation
VERIFIED DUPLICATE of bug 149466
13 years ago
13 years ago

People

(Reporter: Stephane.Gobance, Assigned: dbaron)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910

When I link my HTML page with a CSS (<LINK type="text/css" rel="stylesheet"...),
the first rule of my stylesheet is ignored and the rendering is not proper as I
want!

Reproducible: Always
Steps to Reproduce:
1. Create a simple HTML page like this one:
<html>
<head>
<title>CSS implementation test in Mozilla</title>
<link type="text/css" rel="stylesheet" href="test.css">
</head>

<body>
<p>Is the background colored with the CSS "background-color" property ?</p>
</body>
</html>

2. Create a simple CSS like this:
<style>
<!--
BODY { background-color: rgb(170,200,250) }
-->
</style>

3. Open the HTML page in the browser and you'll see that the bacground color is
not filled at all.

Actual Results:  
The background color (specified in the stylesheet) is not rendered at all
(completely ignored).


Expected Results:  
The background color should be filled with the one specified in the stylesheet.


I have found a workaround to this bug which consists in adding a first empty
rule in the linked CSS file:

<style>
<!--
.mozillabug {}

BODY { background-color: rgb(170,200,250) }
</style>


Then, opening the HTML page in the browser works properly.

I have noticed that the problem also occurs with FireFox !

Comment 1

13 years ago

*** This bug has been marked as a duplicate of 149466 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
vrfy. to be clear: this is not a bug. remove these lines from the css file:
<style>
<!--
Status: RESOLVED → VERIFIED
(Reporter)

Comment 3

13 years ago
Sorry, I had forgotten to remove the comments tags in the CSS file I provided !

However, I had also tested the CSS file without any comment tags and the problem
still occured.

My CSS file called "test.css" is as simple as this: 

<style>
BODY { background-color: rgb(170,200,250) }
</style>

Try again the test and you'll that nothing has been solved.
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
(Reporter)

Comment 4

13 years ago
Sorry but I read too quickly and missed to remove the <style> </style> tags.
I have removed all HTML stuff and everything works now.
I made the same mistake as Robert Burtcher (vipir14@cox.net) by reading
erroneous tutorials about CSS on the web.

*** This bug has been marked as a duplicate of 149466 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago13 years ago
Resolution: --- → DUPLICATE

Updated

13 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.