Class And Id In CSS
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 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.