0

I have a downloaded css file whose size's ok
But in some cases(I have no idea),it just wont work
Is it charset cause this(some comments are Chinese) or Is there any triggers?
And how to test if all rules parsing right?
I came across a common idea:
add a css rule at the bottom of this css file,e.g:.testCss{width:1px} and test if the element with class .testCss 's width is 1px or not
And my other question is?
Are there any solutions to tackle this problem?
Thanks!

4
  • How do you know it's not working? Commented Jun 12, 2012 at 6:35
  • The empty styled page tells me Commented Jun 12, 2012 at 6:37
  • Can you give us some code please? Commented Jun 12, 2012 at 6:38
  • @Lanston That doesn't indicate parsing failure. Open up Chrome and press Ctrl+j. Inspect the elements. Commented Jun 12, 2012 at 6:40

1 Answer 1

2

To parse CSS, go to the W3C CSS validator

If you are using unicode characters, it may be necessary to specify @charset "UTF-8"; at the top of the file. Read up more about data-types in CSS here in the CSS specification.

To check whether specific elements have the right attributes, use either firebug in Firefox (as @dbaseman mentioned) or Safari and Chrome have inbuilt inspectors. You can right click on an element and click 'inspect'.

You can look at the CSS as follows:

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

The problem is :Is there a way to test if it's parsing successfully with some codes?
Firstly, validate it with W3C. Then, if its not working still, check the element on your page with an inspector.
Just to mention: Firefox (at least Version 12) has a pretty good page inspector as well... (faster to use than firebug in my opinion: just right-click the element and hit q).
Thanks - did not realise this. I use Safari personally, and that seems to have a pretty good one too. More and more browsers have implemented native solutions, in accordance with popular demand!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.