Web Design Tutorial – CSS Optimisation Video

Posted on Friday 11th Sep 2009 by James Bavington 8 Comments

This week Nick and Michael discuss how to optimise your CSS files. This has various benefits which are futher explained in the video. Please feel free to add comments to either the blog post or our youtube channel.

Script From The Video Blog

Today’s web design video blog is a little bit different as we are featuring this episode as a guest post in association with webdesignlessons.com.

Earlier in the week, a question was raised by one our of blog readers, asking “Is there any point css optimisation when the file size is still so small? ”

To which we replied “yes! we think so (said together)”.

And for raising this web design hot potato, we thank Belinda from Carlyse

Well, stylesheet Optimisation is the process of ensuring that your CSS source code is concise and efficient. Although you can still create standards compliance websites without optimised CSS, there are other benefits from which we can seek more value.

Writing CSS using the least possible amount of source code is certainly good practice when it comes to web design, firstly, it improves the readability of the code, meaning that not only you, but other designers can easily navigate through your code.

On top of this, future style maintenance efforts could be simplified if you have a better understanding for example of how stylesheets actually cascade.

// Inheritance

Looking at the bigger picture, it is important to realise how styles relate to each other through inheritance.

Certain styles when declared are automatically passed onto to all child elements, including fonts, colors, sizes, text-alignment, etc.

Not all styles share the default inheritance, so it’s worth researching the default properties of individual selectors to improve your understanding.

// Notations

CSS notations are seen in various forms and preferences generally vary between designers.

The most common is of these is multi line notation where each selector sits aligned underneath each other.

This is certainly the easiest to read, however, on larger stylesheets, it can mean a lot of scrolling to find particular styles.

To side step this curve ball, you can keep all of you notations on one line. This makes it a lot easier to find certain styles.

You could in fact put the wholes stylesheet on one line… But that’s ridiculous!.

//A Working Example

Lets look at an example where we can start to actually optimise the code.

Now here’s a file that we have prepared to show how we can optimize the CSS without any effect on how the web page renders.

Now by taking a look at the CSS, we can start to look how to condense the code.

1.Understanding Inheritance

2. Zero Values don’t require a unit

3.Condense Your Colours

4. Condensing tags to share settings

5. margin and padding notation

That sounds I little bit like a song…

Song: If your margin, and your padding, mean that your css is flagging, just remember, you can always do it this way… top right, then bottom then left.

“…Actually it’s a bit like a clock”

Thank you for watching, please subscribe to our YouTube Channel, or follow us on Twitter at http://twitter.com/crearegroup.

About James Bavington

Away from computers, James enjoys mountains, military history and has an insatiable appetite for film - particularly 90's classics.

See all of posts.

Add on James Bavington Google+

James Bavington's Tweet's

This entry was posted in Web Design News, Web Design Videos. Bookmark the permalink.

8 Responses to Web Design Tutorial – CSS Optimisation Video

  1. Peter Poet says:
    September 19, 2009 at 10:21 am

    Very good song, and excelent explaination of advanced CSS

  2. Paul Shadwell says:
    September 22, 2009 at 9:55 pm

    Did I see a light bulb come on at the end there? :-)

  3. Ricky Joyce says:
    October 3, 2009 at 1:22 am

    Hi guys, remember me?
    Great video, still learning from you guys and loving the way your optimizing your CSS, keep up the good work! Much love.

  4. James says:
    October 7, 2009 at 12:00 pm

    Hey Ricky – hope you’re doing well, thank you for the comment.

  5. xaby says:
    October 9, 2009 at 9:22 am

    great video! though i need to adjust to your british accent :)

  6. Gareth Joyce says:
    October 22, 2009 at 6:23 pm

    Hi James,

    Just saw a comment from Ricky Joyce! Who on earth is that my long lost cousin or an imposter?

    Anyway I am subscribed to your blog and I check back regularly to see your pretty faces on YouTube! Hope you are all well and I hope everything is going well with the new creare web design.

    Regards,
    G.

  7. James says:
    October 23, 2009 at 8:28 am

    Hi Gareth, surely you worked the same time as Ricky? Thanks for subscribing, Creare web site is coming along well, lots of new things coming live soon!

  8. Sebby says:
    November 6, 2009 at 1:07 am

    Very tidy! Good Introduction video for Newcomers to CSS. Like the British Accent too :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>