HTML CSS Bootstrap JavaScript jQuery MySQL PHP Data Mining

CSS At-Rules (@) Reference

An **at-rule** is a CSS statement that instructs CSS how to behave. It should always start with an @ symbol.


Essential At-Rules

These rules are fundamental to modern web development.

Rule Description
@media Defines styles based on device characteristics (Respnsive Design).
@keyframes Defines the intermediate steps in a CSS animation.
@font-face Allows you to use custom web fonts not installed on the user's computer.
@import Includes external CSS files within another style sheet.
@charset Specifies the character encoding used in the style sheet.

Code Examples

/* Responsive Viewport */
@media (max-width: 600px) {
    body { font-size: 14px; }
}

/* Custom Font Definition */
@font-face {
    font-family: 'MyFont';
    src: url('myfont.woff2');
}

/* Animation Steps */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

Tip: Always place @charset at the very first line of your CSS file if you are using it. @import should also come before any standard selectors.