Anatomy of a Style Sheet

It is time for some more definitions. Figure 14.4 is a partial view of the CSS behind the default WordPress theme, Kubrick. Looking at style.css, you see something similar to a two-column table, with an object on the left side, some braces, and some settings on the right. The whole thing is called a rule. The object is called a selector, and the stuff inside the braces is a declaration. Each declaration has at least one property (like color, font, margin, or border) and a value (that you set the property to).

The first part of Figure 14.4 is a comment that browsers won't read. Comments are designated in CSS by the opening /* and the closing */ (notice that these two keys are at the top of the number pad on the right side of your standard keyboard).

This comment tells you, the human, something about the theme it describes. This is followed by another comment defining a Typography and Colors section of this site. The functional part of the style sheet follows, with rules for the body text. You might recall that the W3C Validator threw an error for using <font> tags on a website. Yet this first rule in the CSS file defines font-size and font-family. Is this a contradiction? A resounding "No!" comes from the standards crowd. "Font descriptions belong in CSS, and nowhere else!" The

C note

The generic Sans-Serif font is defined by your operating system. In Windows, the Microsoft Sans Serif font is the default; this setting is buried in the Registry under HKEY_LOCAL_MACHINE\ SOFTWARE\Microsoft\Windows NT\CurrentVersion\ FontSubstitutes\MS Shell Dlg. In Linux, the Sans-Serif default depends on your desktop environment. KDE uses Deja Vu Sans as a default, while GNOME uses just plain Sans. The Mac uses Helvetica and Geneva.

The Accidental Blogging Millionaires

The Accidental Blogging Millionaires

Get Inspired By The Most Popular Bloggers Online! If You Want To Skyrocket Your Success With Business And Improve Your Overall Life You Need To Have A Look At The Accidental Blogging Millionaires! Business can be a fight, particularly when you’re trying to establish one online and like all fights, to succeed you must find the winning techniques and apply them.

Get My Free Ebook

Post a comment