CSS stands for Cascading Style Sheets and is used to style HTML elements. It controls colors, fonts, layouts, and spacing, making webpages look nice and organized.
elements have blue text.
The correct CSS property to change text color is color. The syntax uses a colon : to assign values, not equals =.
div {
display: flex;
justify-content: center;
align-items: center;
height: 200px;
border: 2px solid black;
}The display: flex creates a flexible container. justify-content: center centers content horizontally, and align-items: center centers content vertically. The height and border define the box size and outline.
- ?
- , not nested deeper.
ul > li selects only li elements that are immediate children of ul. ul li selects all li descendants, including nested ones.
Relative font sizes like rem or em allow text to scale based on user settings, improving readability. Using poor contrast or disabling zoom harms accessibility.