Build small web components and explain how their HTML, CSS and JavaScript work.
Before starting: Basic HTML and CSS.
Practice project: Build a reusable responsive study card.
Foundation and first practice
- Build a complete study card with your own HTML and CSS
A small project combines meaning and presentation. Start with a heading and paragraph that make sense without styling. Add a class to keep styles scoped, then check the result at a narrow viewport. This example uses no external image, font, script, or stylesheet.
Any modern browser; no external dependencies
<!doctype html> <html lang="en"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Study card</title> <style> .study-card { max-width: 30rem; padding: 1rem; border: 2px solid #075985; border-radius: 1rem; font: 1.1rem/1.6 system-ui; } </style> <article class="study-card"> <h1>Today: loops</h1> <p>Trace three iterations and explain when the loop stops.</p> </article> </html>Check the output
A bordered study card displays a heading and a paragraph. It stays readable when the viewport narrows.Add a second card using the same class. Explain why a reusable class is preferable to duplicated inline styling.
Open the Web UI recipes learning path on DevStudyHub · Play coding games on this blog
No comments:
Post a Comment
Please do not enter any spam link in the comment box.