This concise Cheat Sheet covers selectors, box models, layout, Animations, typography, etc... With basic syntactical representation along with examples.
Short intro to CSS3
CSS3 (Cascading Style Sheets, level 3) is the latest version of CSS, which is an extension of CSS2. It was first released in 1999 and is ongoing, it has been divided into several different modules, and each module addresses a specific area of styling and layout, such as text effects, color, backgrounds, and layout.
All new features in CSS
CSS3 introduces several new features and improvements over previous versions of CSS, some of the notable new features are:
- Selectors: CSS3 allows for a more advanced and accurate selection of elements on a page, including the ability to select elements based on their attributes and relationships to other elements.
- Box Model: CSS3 introduces new layout modules like Flexbox, Grid, and Multi-column layout which makes it easier to create complex responsive layouts.
- Backgrounds and Borders: CSS3 allows for more advanced control over backgrounds and borders, including rounded corners, background gradients, and background images.
- Text Effects: CSS3 allows for more advanced text effects, such as text shadows, rounded corners, and text gradients.
- 2D/3D Transforms: CSS3 allows for 2D and 3D transformations of elements, including rotation, scaling, and skewing.
- Animations: CSS3 allows for the creation of animations using keyframes, which makes it possible to create complex animation sequences without JavaScript.
- Multiple Columns: CSS3 allows for the creation of multi-column layouts for text and other elements.
- User Interface Elements: CSS3 allows for the creation of various UI elements like tool tips, modal dialogs, and forms that previously required JavaScript.
- Media Queries: allow you to apply CSS styles based on conditions like the screen size and the device.
- Flexbox: Flexbox allows you to make responsive layouts easily, It is a one-dimensional layout system that can be used to create complex, responsive layouts with minimal code.
Let us understand the new properties of css3 with the following table,
In Deep:
New Property |
Syntax/Representation |
Example |
Font face |
|
|
Border radius |
|
|
Box Shadow |
|
|
Background size |
|
|
Border image |
|
|
Text shadow |
|
|
Text overflow |
|
|
Box sizing |
|
|
Color |
|
|
Media query |
|
|
Transition |
|
|
Flexbox |
|
|
Grid |
|
|
Gradients |
|
|
Opacity |
|
|
Animations |
|
|
Transformations |
|
|
Translation |
|
|
CSS 3 Browser compatibility
CSS3 is a standard that is gradually being adopted by web browsers. However, not all browsers support all of the features of CSS3 and some features may require vendor prefixes to work in certain browsers. But we can resolve this issue by using vendor prefixes and fallback styles, better we can check the property status on the caniuse website for better results.
Comments