Catalog / HTML/CSS Cheatsheet
HTML/CSS Cheatsheet
A comprehensive cheat sheet covering essential HTML elements and CSS properties for web development, providing quick references and examples for efficient coding.
HTML Fundamentals
Basic Structure
|
|
|
|
|
Example:
|
Text Formatting
|
Defines HTML headings. |
|
Defines a paragraph. |
|
Inserts a single line break. |
|
Defines a thematic break (horizontal rule). |
|
Defines bold text. |
|
Defines italicized text. |
Lists
|
Defines an unordered list. |
|
Defines an ordered list. |
|
Defines a list item. |
Example of Unordered List: |
|
Example of Ordered List: |
|
CSS Fundamentals
Basic Syntax
CSS rulesets consist of a selector and a declaration block:
|
Example:
|
Selectors
|
Selects all HTML elements of the specified type. |
|
Selects all elements with the specified class. |
|
Selects the element with the specified id. |
|
Selects all HTML elements on the page. |
|
Selects all elements that are a direct child of a specified element. |
|
Selects the first element that is immediately preceded by the specified element. |
Box Model
The CSS box model is a container that contains multiple properties to format any HTML element:
|
|
HTML Forms
Form Elements
|
Defines an HTML form for user input. |
|
Defines an input field where the user can enter data. |
|
Defines a multiline text input control. |
|
Defines a label for an |
|
Defines a drop-down list. |
|
Defines a clickable button. |
Input Types
|
|
|
|
|
|
Form Attributes
|
Specifies where to send the form-data when a form is submitted. |
|
Specifies the HTTP method to use when submitting the form-data (usually |
|
Specifies a name for the form (to differentiate the forms). |
|
Specifies the value of an input element. |
|
Specifies a short hint that describes the expected value of an input field. |
|
Specifies that an input field must be filled out before submitting the form. |
CSS Layout
Display Property
The Common values include: |
|
Flexbox
|
Enables flexbox layout for the container. |
|
Specifies the direction of the flex items ( |
|
Aligns flex items along the main axis ( |
|
Aligns flex items along the cross axis ( |
Example: |
|
Grid
|
Enables grid layout for the container. |
|
Defines the number and size of columns in the grid. |
|
Defines the number and size of rows in the grid. |
|
Specifies the size of the gap between rows and columns. |
Example: |
|