HTML and CSS Reference
In-Depth Information
The prefixed versions of the property could then be removed over time as the property
is standardized and web browser vendors become compliant with the final specification.
Note If you encounter a CSS property in this chapter that does not work in a browser
you test it in, try adding the appropriate browser prefix and see whether that is the issue.
Essential CSS selector syntax
Selectors are the bridge between your CSS style declarations and the HTML content
they need to affect. The majority of selectors you will run into will likely fall into one
of three categories: type selectors, ID selectors, and class selectors. There are other cat-
egories that we'll get to in due course, but these three are the most common.
Type selectors allow any element to be referenced by its HTML element type name,
such as p , article , em , li , blockquote , and so forth. ID selectors allow a specific
element to be referenced that has its global id attribute set to some value. Class select-
ors work the same as ID selectors, except they reference all elements with their class
attribute set to some value. These three categories of selectors are termed simple select-
ors and are summarized in Table 6-3 .
As you can see in Table 6-3 , the ID selector prefixes the value of the ID with a hash
sign. Another example might look like this:
#company-name { font-weight:bold; }
 
Search WWH ::




Custom Search