70 Expert Ideas For Better CSS Coding | Smashing Magazine
Popularity Report
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
URL Tag Cloud
Groups (2)
-
-
City of Mankato .NET
2 members,86 bookmarks
Private group for sharing links between the .NET developers at the City Of Mankato
Bookmark History
Saved by 112 people (24 private), first by anonymouse user on 2007-05-10
- Uuunit on 2008-10-01 - Tags imported , Bookmarks , Read , It , Later
- Fazolet on 2008-09-02 - Tags no_tag
- Majorp on 2008-08-09 - Tags webdev , webdesign , css
- Andymatic on 2008-08-01 - Tags webdev , css
- Piercedlogic on 2008-08-01 - Tags css , webdesign , design , webdev , reference , code , web , howto
Public Sticky notes
Highlighted by hanswobbe
Highlighted by jonphipps
- Use CSS Constants for faster development. “The concept of constants – fixed values that can be used through your code [is useful]. [..] One way to get round the lack of constants in CSS is to create some definitions at the top of your CSS file in comments, to define ‘constants’. A common use for this is to create a ‘color glossary’. This means that you have a quick reference to the colors used in the site to avoid using alternates by mistake and, if you need to change the colors, you have a quick list to go down and do a search and replace.” [Rachel Andrew]
# /*# Dark grey (text): #333333# Dark Blue (headings, links) #000066# Mid Blue (header) #333399# Light blue (top navigation) #CCCCFF# Mid grey: #666666# */
Highlighted by moultriecreek
Highlighted by trigger
/* Structure */, /* Typog
Highlighted by jtraub
font-size is 16px; applying the rule, you’ll get one Em standing for roughly ten pixels (16 x 62.5% = 10). “I tend to put a font-size on the body tag with value: 62.5%. This allows you to use EMs to specify sizes while thinking in PX terms, e.g. 1.3em is approximately 1.3px. ” [Jonathan Snook]
Highlighted by mal0ney
line-height. “line-height:1.4” for readable lines, reasonable line-lengths that avoid lines much longer than 10 words, and colors that provide contrast without being too far apart.
Highlighted by mal0ney
- You can use child selectors. “A child selector targets an immediate child of a certain element. A child selector consists of two or more selectors separated by a greater than sign, “>”. The parent goes to the left of the “>”, and whitespace is allowed around the combinator. This rule will affect all strong elements that are children of a div element. [Roger Johansson]
div > strong { color:#f00; }
Highlighted by mal0ney
- The selector in the following rule matches all
pelements that have atitleattribute, regardless of which value it has:
p[title] { color:#f00; } >
Highlighted by mal0ney
Highlighted by mal0ney
- he selector matches all div elements that have a class attribute with the value error:
div[class=error] { color:#f00; }
Highlighted by mal0ney


Public Comment
on 2007-08-23 by tinotriste