General Databases (71) Linux (42) Outside the Cube (2086) Programming (730) Web publishing (118) about DelphiFAQ (12) JavaScript (55) perl CGI (3) VBScript (1) Web Hosting (8) Windows (355)
Exchange Links About this site Links to us
|
FireFox error "Selector expected. Ruleset ignored due to bad selector"
7 comments. Current rating: (1 votes). Leave comments and/ or rate it.
Question: The javascript-console of FireFox gives me these errors:
Error: Selector expected. Ruleset ignored due to bad selector.
followed by
Error: Unexpected end of file while searching for closing } of invalid rule set.
Do you have any ideas on what this means and how to resolve it?
Answer: Review your .CSS style sheet file. You probably have HTML comments in there, similar to what people put in Javascript sections. Remove those comments as shown below.
 | |  | |
<style>
<!--
.styling { blah... }
</style>
<style>
.styling { blah... }
</style>
| |  | |  |
Comments:
|
|
|
|
Where's the .CSS style sheet file located?
|
|
|
|
|
|
2007-01-28, 09:27:06 (updated: 2007-01-28, 09:27:22) |
|
|
|
To anonymous in United Kingdom:
I looked at your CSS file. If it is an external .css file, you should not include the <style> and </style> lines.
|
|
|
|
|
Hey that worked. Thanks.
|
|
|
|
|
When you are put an semicolon after the } in the styles(like this
.stylename{
width:10%
};
) at that time also this error will come. Just remove the semicolon then it will works
use this(
.stylename{
width:10%
}
)
|
2007-09-20, 15:43:52 (updated: 2007-09-20, 15:44:42) |
|
|
|
You may also have something like this in your CSS:
.whatever, {
...
}
The extra comma shouldn't be there, so just remove it:
.whatever {
...
}
|
|
|
|
|
I actually got this error because I named one of my classes starting with a number:
<style type='text/css' >
.100Percent
{
width: 100%;
}
</style>
When I changed it to the following the error went away:
<style type='text/css' >
.OneHundredPercent
{
width: 100%;
}
</style>
|
|