Class And Id In CSS
HTML-код
- Опубликовано: 8 сен 2024
- In CSS, a class is used to style multiple elements by assigning them the same class attribute, which is prefixed with a dot (.) in the CSS file. An ID, on the other hand, is unique to a single element and is prefixed with a hash (#) in the CSS file. Classes allow for reusability of styles across various elements, while IDs are used for unique styling of specific elements.