Exercises in CSS
Sure! Here are some CSS exercises to help you practice and sharpen your skills, from beginner to intermediate levels:
? Beginner Exercises
Style a Simple Webpage
Create a webpage with a header, paragraph, and footer.
Set background color, font family, and text colors.
Add padding and margin to elements.
Center a Div
Create a fixed-size box and center it horizontally and vertically using CSS.
Style Links
Change the color of links.
Add hover effects (e.g., underline on hover).
Buttons
Style a button with background color, padding, border-radius, and hover color changes.
? Intermediate Exercises
Navigation Bar
Create a horizontal navigation bar with inline links.
Highlight the active link.
Make it responsive (stack vertically on small screens).
Flexbox Layout
Create a 3-column layout using flexbox.
Make columns equal width with spacing in between.
Dropdown Menu
Create a CSS-only dropdown menu that appears on hover.
Grid Layout
Create a grid gallery with 4 images per row.
Add gaps between grid items.
Card Component
Design a card with an image, title, description, and button.
Add a box-shadow and rounded corners.
? Advanced Challenges
Responsive Layout
Build a fully responsive webpage using flexbox or grid that adapts to mobile and desktop.
CSS Animations
Animate a button color or size on hover.
Create a loading spinner with keyframes animation.
Custom Form Styling
Style inputs, selects, and buttons with focus and error states.
If you want, I can give you starter code or solutions for any of these exercises! Which one would you like to try first?