Mastering CSS: Your Comprehensive Reference Sheet
Cascading Style Sheets (CSS) is a fundamental web development language used to describe the look and formatting of a document written in HTML. This CSS reference sheet is designed to help you understand and apply CSS properties, selectors, and at-rules, making your web development journey more efficient and enjoyable.
CSS Selectors
Selectors are used to target HTML elements. They are the first part of every CSS rule. Understanding selectors is crucial as it helps you apply styles to specific elements, classes, or IDs.
- Element Selectors: Target HTML elements, e.g.,
pfor paragraphs. - Class Selectors: Target elements with a specific class, e.g.,
.button. - ID Selectors: Target elements with a unique ID, e.g.,
#navbar. - Attribute Selectors: Target elements with specific attributes, e.g.,
input[type="text"]. - Pseudo-Classes: Target elements based on their state, e.g.,
:hover.
CSS Properties
CSS properties define the styles applied to selected elements. They are divided into several categories, including background, border, box model, color, font, list, table, and more.

Background Properties
| Property | Description |
|---|---|
background-color |
Sets the background color of an element. |
background-image |
Sets the background image of an element. |
background-repeat |
Specifies how a background image is repeated. |
Border Properties
border-width: Sets the width of an element's border.border-style: Sets the style of an element's border.border-color: Sets the color of an element's border.
CSS Box Model
The CSS box model is a rectangular box that represents an HTML element. It consists of margins, borders, padding, and content. Understanding the box model is essential for precise layout control.
CSS At-rules
At-rules are used to group related styles, define media queries, and more. They start with an @ symbol followed by a keyword, such as @import or @media.
@import
The @import at-rule is used to import styles from an external stylesheet. It allows you to keep your CSS organized by separating styles into different files.

@media
The @media at-rule is used to apply different styles for different media types/devices. It enables responsive design, ensuring your website looks good on various screen sizes and devices.
This CSS reference sheet provides a solid foundation for understanding and applying CSS properties, selectors, and at-rules. As you continue your web development journey, you'll find that CSS is a powerful and flexible language that allows you to create visually appealing and functional websites. Happy coding!






















