0% found this document useful (0 votes)
7 views1 page

CSS Rules and Styling Basics

The document discusses the basic structure and syntax of CSS including rules, selectors, properties, values, inheritance, and validation. Rules consist of selectors and declarations containing properties and values within curly braces. Selectors specify elements a rule applies to and multiple selectors can be separated by commas. Styles can be included via <style> tags or linked external style sheets. Many properties inherit values to child elements and can be overridden. Classes are selected with a period before the class name.

Uploaded by

Kapil Gautam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

CSS Rules and Styling Basics

The document discusses the basic structure and syntax of CSS including rules, selectors, properties, values, inheritance, and validation. Rules consist of selectors and declarations containing properties and values within curly braces. Selectors specify elements a rule applies to and multiple selectors can be separated by commas. Styles can be included via <style> tags or linked external style sheets. Many properties inherit values to child elements and can be overridden. Classes are selected with a period before the class name.

Uploaded by

Kapil Gautam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

BULLET POINTS CSS contains simple statemlents, called rules.

Each rule provides the style for a selection of XHTML elements. A typical rule consists of a selector along with one or more properties and valu es. The selector specifies which elements the rule applies to. Each property declaration ends with a semicolon. All properties and values in a rule go between {} braces. You can select any element using its name as the selector. By separating element names with commas, you can select multiple elements at onc e. One of the easiest ways to include a style in HTML is the <style> tag. For XHTML and for sites of any complexity, you should link to an external style sheet. The <link> element is used to include an external style sheet. Many properties are inherited. For instance, if a property that is inherited is set for the <body> element, all the <body>'s child elements will inherit it. You can always override properties that are inherited by creating a more specifi c rule for the element you'd like to change. Use the class attribute to add elements to a class. Use a "." between the element name and the class name to select a specific eleme nt in that class. Use ".classname" to select any elements that belong to the class. An element can belong to more than one class by placing multiple class names in the class attribute with spaces between the names. You can validate your CSS using the W3C validator, at [Link] alidator.

You might also like