0% found this document useful (0 votes)
1 views

CSSSS

The document explains the components of CSS, including selectors, declarations, properties, and values. It describes various types of selectors such as universal, element, and pseudo-class selectors, and details how declarations consist of properties and values that define styling. Additionally, it covers the different forms of values in CSS, including text, integers, units, and URLs.

Uploaded by

iprav1999
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

CSSSS

The document explains the components of CSS, including selectors, declarations, properties, and values. It describes various types of selectors such as universal, element, and pseudo-class selectors, and details how declarations consist of properties and values that define styling. Additionally, it covers the different forms of values in CSS, including text, integers, units, and URLs.

Uploaded by

iprav1999
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Selector: This indicates or selects the HTML element(s) or contents [e.

g
attributes, ids, and classes] to which a set of styling rules apply. It is usually
at the beginning of the ruleset. For instance, in the illustration above, the
<body> element is the selector. To style a different element you simply have to
change the selector. Other forms of selectors in CSS include;

a universal selector - denoted by the symbol * and which affects all elements (e.g
heading, paragraph, list, etc.) on a document tree or all values of a particular
element.

an element selector - also known as a tag or type selector, is a commonly-used


selector in CSS that involves all HTML elements of an identified type when that
type is specified. Multiple elements can also be selected with the use of a comma,
and a single ruleset applied to them all as follows 👉 h1, p, li, {color: blue;}.

pseudo-class - is a keyword added to a selector that specifies a special state of


the selected element, for instance in this ruleset 👉 a:hover {color: blue;}, the
color of the selector a changes to blue when the mouse pointer hovers over the
link.

Declaration: This declares the property of an HTML element to be styled. It


determines how elements are formatted on a webpage. Each declaration is made up of
a property and a property value which are separated by a colon. Declarations within
a block are separated by a semicolon. For example font-style: italic; color: blue;.

Property: This is the attribute to be styled in an HTML document. Different HTML


selectors and elements have different properties, properties specify what to style
on a CSS selector. This could be the background of the HTML elements or its color
or font. Just like the CSS selector, some properties are universal and can be used
on any element while others apply only to specific groups of elements and under
particular conditions. In the example above, the property of the body element
chosen to be styled is its color. Frequently used properties in CSS documents
include list properties; font properties; border properties; and text properties.

Values: are written after the colon that separates them from the properties in CSS.
The word values can be quite misleading though because CSS values are not just
text; they are often in different forms like integers, units, strings, URLs, etc.
See below for more details 👇

text values - are quite common in CSS and are usually written without quotes.
italic and blue are the text values of font-style and color in the CSS ruleset
above.

integers - are numbers from zero to nine. Some CSS properties allow their values to
be described as negative integers. An example of an integer is "6" as a value for
the property column-count. It isn't uncommon to see some properties like margin
take on two values (e.g. 3 auto;). When this occurs, the first value (3 in this
case) affects the element's top and bottom side while the second value affects the
left and right side [note that 'auto' is a special value that divides the available
horizontal space evenly between left and right].

units/measurements - many properties in CSS take this as their value to effectively


position general layout and media queries on a webpage. Examples of property-
specific units for CSS values include; pc - the unit for picas; em - for the
calculated size of a font; cm - the unit for centimeters; pt - for points (as a
measurement in printed media); and % - the unit for percentages.

URLs - properties like background-image often take an actual URL as their value. A
URL could be absolute or relative meaning that the address of an image could either
be copied online and used as a background image or an image could be uploaded
directly from the user's computer. For example: div{background-image:
url("./images/picture.jpg");}

Selector: This indicates or selects the HTML element(s) or contents [e.g


attributes, ids, and classes] to which a set of styling rules apply. It is usually
at the beginning of the ruleset. For instance, in the illustration above, the
<body> element is the selector. To style a different element you simply have to
change the selector. Other forms of selectors in CSS include;

a universal selector - denoted by the symbol * and which affects all elements (e.g
heading, paragraph, list, etc.) on a document tree or all values of a particular
element.

an element selector - also known as a tag or type selector, is a commonly-used


selector in CSS that involves all HTML elements of an identified type when that
type is specified. Multiple elements can also be selected with the use of a comma,
and a single ruleset
Selector: This indicates or selects the HTML element(s) or contents [e.g
attributes, ids, and classes] to which a set of styling rules apply. It is usually
at the beginning of the ruleset. For instance, in the illustration above, the
<body> element is the selector. To style a different element you simply have to
change the selector. Other forms of selectors in CSS include;

a universal selector - denoted by the symbol * and which affects all elements (e.g
heading, paragraph, list, etc.) on a document tree or all values of a particular
element.

an element selector - also known as a tag or type selector, is a commonly-used


selector in CSS that involves all HTML elements of an identified type when that
type is specified. Multiple elements can also be selected with the use of a comma,
and a single ruleset applied to them all as follows 👉 h1, p, li, {color: blue;}.

pseudo-class - is a keyword added to a selector that specifies a special state of


the selected element, for instance in this ruleset 👉 a:hover {color: blue;}, the
color of the selector a changes to blue when the mouse pointer hovers over the
link.

Declaration: This declares the property of an HTML element to be styled. It


determines how elements are formatted on a webpage. Each declaration is made up of
a property and a property value which are separated by a colon. Declarations within
a block are separated by a semicolon. For example font-style: italic; color: blue;.

Property: This is the attribute to be styled in an HTML document. Different HTML


selectors and elements have different properties, properties specify what to style
on a CSS selector. This could be the background of the HTML elements or its color
or font. Just like the CSS selector, some properties are universal and can be used
on any element while others apply only to specific groups of elements and under
particular conditions. In the example above, the property of the body element
chosen to be styled is its color. Frequently used properties in CSS documents
include list properties; font properties; border properties; and text properties.

Values: are written after the colon that separates them from the properties in CSS.
The word values can be quite misleading though because CSS values are not just
text; they are often in different forms like integers, units, strings, URLs, etc.
See below for more details 👇

text values - are quite common in CSS and are usually written without quotes.
italic and blue are the text values of font-style and color in the CSS ruleset
above.

integers - are numbers from zero to nine. Some CSS properties allow their values to
be described as negative integers. An example of an integer is "6" as a value for
the property column-count. It isn't uncommon to see some properties like margin
take on two values (e.g. 3 auto;). When this occurs, the first value (3 in this
case) affects the element's top and bottom side while the second value affects the
left and right side [note that 'auto' is a special value that divides the available
horizontal space evenly between left and right].

units/measurements - many properties in CSS take this as their value to effectively


position general layout and media queries on a webpage. Examples of property-
specific units for CSS values include; pc - the unit for picas; em - for the
calculated size of a font; cm - the unit for centimeters; pt - for points (as a
measurement in printed media); and % - the unit for percentages.

URLs - properties like background-image often take an actual URL as their value. A
URL could be absolute or relative meaning that the address of an image could either
be copied online and used as a background image or an image could be uploaded
directly from the user's computer. For example: div{background-image:
url("./images/picture.jpg");}

Values: are written after the colon that separates them from the properties in CSS.
The word values can be quite misleading though because CSS values are not just
text; they are often in different forms like integers, units, strings, URLs, etc.
See below for more details 👇

text values - are quite common in CSS and are usually written without quotes.
italic and blue are the text values of font-style and color in the CSS ruleset
above.
integers - are numbers from zero to nine. Some CSS properties allow their values to
be described as negative integers. An example of an integer is "6" as a value for
the property column-count. It isn't uncommon to see some properties like margin
take on two values (e.g. 3 auto;). When this occurs, the first value (3 in this
case) affects the element's top and bottom side while the second value affects the
left and right side [note that 'auto' is a special value that divides the available
horizontal space evenly between left and right].

units/measurements - many properties in CSS take this as their value to effectively


position general layout and media queries on a webpage. Examples of property-
specific units for CSS values include; pc - the unit for picas; em - for the
calculated size of a font; cm - the unit for centimeters; pt - for points (as a
measurement in printed media); and % - the unit for percentages.

URLs - properties like background-image often take an actual URL as their value. A
URL could be absolute or relative meaning that the address of an image could either
be copied online and used as a background image or an image could be uploaded
directly from the user's computer. For example: div{background-image:
url("./images/picture.jpg");}

You might also like