17

I am writing some CSS files, but when I make a mistake, Chrome appears to just silently ignore the parts that I screw up, and renders the rest.

This makes it annoying to debug since I can't figure out what is going wrong.

So, is there a way to get Chrome to "scream at me in big red letters," so that I can spend less time finding the error and more time fixing it?

1
  • 1
    You can use the element inspector in chrome to see the CSS applied to an element and overruled/ignored CSS rules. To open the element inspector you can use f12 or ctrl+shift+j. Commented Jun 16, 2012 at 17:49

2 Answers 2

6

While you can not "debug" CSS, because it is not a scripting language, you can utilize the Chrome DevTools Elements panel to inspect an element & view the Styles pane on the right. This will give you insights as to the styles being overridden or ignored (line threw). The Styles pane is also useful because of it's ability to LiveEdit the document being inspected, which may help you iron out the issues. If the styles are being overridden, you can then view the Computed Style pane to see the CSS that is actually being utilized to style your document.

To bring up the Chrome DevTools window, hit Ctrl+Shift+I in a Chrome browser tab. (Command+Opt+I for a mac)

For more info visit https://developer.chrome.com/devtools/index

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

Comments

3

As CSS is not a scripting language, you cant properly debug it. Anyway if you know where it goes wrong you can try to tune it by hand.

Aditionally you've got the w3c validator here: http://jigsaw.w3.org/css-validator/ which may give you some feedback

1 Comment

How can you use that if you are developing an app locally. For example, I am using Visual Studio 2013 and run an app by pressing F5.

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.