DelphiFAQ Home Search:
General :: Web publishing
Information about web publishing, how to maintain, optimize and promote a web site.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

FireFox error "Selector expected. Ruleset ignored due to bad selector"

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.

// this will cause an error in Firefox:

     <style>
     <!--
        .styling { blah... }
     //-->
    </style>
 
 
 // this is ok:

     <style>
        .styling { blah... }
     </style>
 

Generated 20:02:21 on Nov 21, 2017