Course
Data Types
CSS Tutorial
This CSS tutorial is designed for beginners to navigate through the essentials and intricate aspects of CSS styling. Upon finishing this tutorial, participants will possess a comprehensive understanding of CSS, setting a solid foundation for further exploration and mastery. This guide aims to equip you with the skills necessary to transform your visions into visually appealing web designs, laying the groundwork for your journey towards becoming an accomplished web designer.
Data Types
CSS data types define the types of values that can be used for various CSS properties. Each CSS property expects a specific type of value, and understanding these data types is essential for properly styling and formatting web content.
The types listed below are the most common, however it is not a complete list of all types defined in any CSS specification.
Syntax
selector { property: <unit-data-type>;}
CSS syntax uses a keyword between the inequality signs "<" and ">" to indicate data types.
Textual Data Types
These types include keywords, identifiers, strings, and URLs.
Pre-defined Keywords
Represents a predefined keyword that is specific to the property it's used with (e.g., auto, inherit, none).
CSS-wide keywords
The table given below lists all the CSS-wide keywords:
Numeric Data Types
These data types represent quantities, indexes, and positions. The following table lists all the numeric data types:
Quantities
Distance and other quantities are defined using these types. The following table lists all the quantities:
Combinations of Types
CSS properties that accept both a dimension and a percentage value fall in this category. The percentage value will be converted to a quantity relative to the allowable dimension. Properties that take both a percentage and a dimension will use one of the following types:
Color
The following table lists all the color related data types:
Images
CSS Images Specification defines image-related data types, such as gradients. The following table lists all the images related data types:
2D Positioning
The following table lists all the 2D Positioning related data types:
Calculation Data Types
CSS math functions use these data types in calculations. The following table lists all the calculation data types:
Display
The table given below lists all the display related data types:
Other Data Types
The table given below lists some more data types: