Time for action – using the W3C's CSS validator

Let's use the W3C's CSS validator service to check that. Again, the process for validating our code is different, depending on whether you're working locally or remotely. First, the process for working remotely:

  1. Go to http://jigsaw.w3.org/css-validator/.
  2. Type in the URL of the site running your theme—in the case of my site, it's http://rachelmccollin.co.uk/opensourcemagazine/.
  3. Click on the Check button.

Next, the process if you're working locally:

  1. Save a static HTML file with the markup that WordPress outputs from your theme. To do this, in your browser, click on Save Page As and save as an HTML file.
  2. Go to http://jigsaw.w3.org/css-validator/.
  3. Click on the Validate by File Upload tab.
  4. Upload your file.
  5. Click on the Check button.

What just happened?

Here you'll want to see another screen with a green bar that says Congratulations! No Error Found.

However, for our theme, we won't get this screen! We're using several new CSS3 properties, that haven't made it officially into the specification, yet browsers are implementing them by adding their own, specific browser prefixes. This means our rounded corner and gradient properties fail, as shown in the following screenshot:

What just happened?

You'll simply need to be aware of which CSS3 properties you're using, and if you don't get the green bar, the validator will display the offending error and again offer suggestions on how to fix it. The CSS validator will also show you the line the offending code is on. This is handy, as your stylesheet is not affected by WordPress output, so you can go directly to the line in your stylesheet file and make the suggested fix.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset