Ah, syntax!
March 20, 2008 – 2:55 pmPicking up on Collin’s recommendation of Eric Meyer for instruction in CSS, I Googled Meyer and found his site, which includes information on his books as well as links to CSS stuff he’s written for the web. I was happily looking around on his site until I realized that nothing seemed to be directed at someone like me: a real beginner. I found that at least parts of his book CSS: The Definitive Guide can be found online. I began reading it and noticed some inward contraction around my heart as I read the Preface, which included what were clearly meant to be helpful explanations, like this one:
Every word or bracketed group may be followed by one of the following modifiers:
- An asterisk (*) indicates that the preceding value or bracketed group is repeated zero or more times. Thus, bucket* means that the word bucket can be used any number of times, including zero. There is no upper limit defined on the number of times it can be used.
- A plus (+) indicates that the preceding value or bracketed group is repeated one or more times. Thus, mop+ means that the word mop must be used at least once, and potentially many more times.
- A question mark (?) indicates that the preceding value or bracketed group is optional. For example, [pine tree]? means that the words pine tree need not be used (although they must appear in that exact order if they are used).
- A pair of numbers in curly braces ({M,N}) indicates that the preceding value or bracketed group is repeated at least M and at most N times. For example, ha{1,3} means that there can be one, two, or three instances of the word ha.
Um, yeah. I don’t understand.
So I decided to turn to the nice tutorial provided by Web3Schools. There I found the thing that gave me instant comfort: a grammar:
The CSS syntax is made up of three parts: a selector, a property and a value:
selector {property: value}
Ahhh. I instantly felt better. The basic building blocks of this foreign language: selector, property, value. I have a starting point now, a foundation for learning.
In fact, I can no back and read that excerpt from Meyer with fresh eyes. Each of the bullet points deal with a “preceding value.” Ok–makes sense. These items modify the preceding value, like an adjective modifies a noun. Got it.
Learning grammar. It’s a wonderful thing to do before setting out to be a full scale rhetorician.