Coming Soon in 2011
( to a theater near you )
CSS Selectors: Type, Class, and ID by kirupa (https://www.kirupa.com/me/index.htm) | filed under HTML and CSS (https://www.kirupa.com/html5/learn_html_css.htm) By now, you probably know that you use CSS styles to alter the look of your HTML document. The way CSS bobs and weaves through your document to style the right elements is both fascinating as well as useful for you to understand if you want to create great looking applications and web sites. In this tutorial, you will learn how common CSS selectors work to map a particular rule to elements in your document. We will start off by deconstructing and understanding very simple examples and then moving to more complicated examples that you will encounter...in the wild! Note If any of the CSS terminology such as selectors and rules is unfamiliar to you, check out the Anatomy of a CSS Style 101 (https://www.kirupa.com/html5/anatomy_css_style_101.htm) article for a quick introduction. A Simple Type Selector Let's first start by looking at a simple style rule whose selector applies to all p tags: p { font-family: Cambria, serif; font-size: xx-large; } With what we have here, if any p tags are encountered in our HTML document, this rule will get applied. For example, the following text will fall under the influence of this rule:
Do or do not...there is no try.
This doesn't seem too crazy, right? Because our browser sees a match between the p selector in the style rule and the p tag in your document, it applies this style to that element. This type of a selector is known as a type selector because it applies to elements whose types match what it specifies. Let's say our document had many p tags with some p tags nested inside other elements:Do or do not...there is no try.
Coming Soon in 2011
( to a theater near you )
|
column1 |
column2 |
|
data1 |
data2 |
Coming Soon in 2011
( to a theater near you )
Coming Soon in 2011
( to a theater near you )
Do or do not...there is no try.