demosthenes.info

I’m Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with , and . To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

web developer guide

my books

Book cover of Pro CSS3 AnimationPro CSS3 Animation, Apress, 2013

my projects

CSSslidy: an auto-generated #RWD image slider. 1.5K of JS, no JQuery. Drop in images, add a line of CSS. Done.

tipster.ioAutomatically provides local tipping customs and percentages for services anywhere.

General rules for creating CSS

css / introduction

Estimated reading time: 30 seconds

  • Try to avoid inline and embedded styles as much as possible.
  • Write your HTML first, then link to a style sheet. Trying to do both at the same time almost always results in confusing and messy code.
  • Create style rules for the “biggest” tags first: body (and, if necessary, html).
  • Try to create your style rules in the same order as the elements appear in the page: that is, body first, followed by h1, h2, etc.
  • Create rules that are true for the majority of content influenced by a particular element, such as p, then create rules for exceptions.
comments powered by Disqus

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.