Navigate
JavaScript Tutorial for Beginners
The Ultimate CSS Tutorial for Beginners
Data Structure Tutorial for Beginners
ReactJS Tutorial for Beginners
Java Tutorial for Beginners
Node.js Tutorial for Beginners
SQL Tutorial for Beginners
Basic Styling
Content
- Basic Styling
- Text Styling
- Backgrounds
- Borders
- Margins and Padding
- Updated on 10/09/2024
- 450 Views
Text Styling
Color: Changes the text color.
Font: Changes the font family.
Size: Adjusts the font size.
Backgrounds
Background Color: Changes the background color.
Borders
Border Style: Defines the border style (solid, dashed, etc.).
Margins and Padding
Margin: Space outside the element.
Padding: Space inside the element.
Activity
Create a CSS file and style an HTML page with different text colors, fonts, and sizes. Add a border and background color to a div element and adjust its margin and padding.
Quiz
1. How do you change the text color in CSS?
- a) font-color
- b) text-color
- c) color
- d) text-style
2. True or False: The font-family property is used to change the font size.
- a) True
- b) False
3. What CSS property changes the background color?
- a) bg-color
- b) background
- c) background-color
- d) color
4. How do you add space inside an element?
- a) margin
- b) padding
- c) border
- d) spacing
5. True or False: Border style can be solid, dashed, or dotted.
- a) True
- b) False
Unlock Expert Career Advice For Free
