Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Congratulations on reaching Chapter 12! 🎉
Over the past 11 chapters, you have learned the core building blocks of CSS:
rem, %, px)relative, absolute, z-index)Now, it is time to assemble these individual skills into your first complete, portfolio-ready CSS project: A modern Student Profile & ID Card!
Here is the visual layout of the profile card we are building:
+-------------------------------------------------------------+ | [TOP BANNER: Royal Blue & Violet Linear Gradient] | | | | +-----------------+ | | | [BADGE] PREFECT | | | | (pos: absolute) | | | +-----------------+ | | +-----------------------+ | | | CIRCULAR AVATAR | | | | (border-radius: 50%) | | | | (overlapping banner) | | | +-----------------------+ | | | | Aarav Sharma | | Head Boy | Class 10-A | | Delhi Model Senior Secondary School | | | | SKILLS & INTERESTS (Flexbox Row): | | [ Python ] [ Web Design ] [ Cricket ] [ Robotics ] | | | | ACTION BUTTONS (Flexbox Space-Between): | | [ View Marksheet ] [ Send Message ] | +-------------------------------------------------------------+
box-sizing: border-box; with margin: 40px auto; to center the card on the page.linear-gradient for the top cover banner.border-radius: 50%; with a negative top margin (margin-top: -60px;) and a thick white border ring to make the portrait pop over the banner.position: absolute; top: 16px; right: 16px;).display: flex; gap: 8px; flex-wrap: wrap;.display: flex; gap: 12px;.transform: translateY(-6px); and an elevated box-shadow.Create a file named student-profile-card.html in your editor and paste the following complete code:
border-radius: 20px; overflow: hidden; on .profile-card:Because the .card-banner has square top corners, setting overflow: hidden; on the parent card automatically clips the banner's corners to match the card's 20px curves!
margin-top: -55px; pulls the avatar circle exactly 55px upwards into the gradient banner, creating that iconic modern profile card overlap!
flex: 1; on the Action Buttons:Inside .action-group { display: flex; }, setting flex: 1 on both buttons ensures they share horizontal space 50/50 with zero math required.
height: 400px.transition: all 0.2s ease; on interactive buttons and cards to avoid jarring visual jumps.overflow: hidden; applied to the .profile-card parent container?border-radius: 50%; turn a square <div> (110px $\times$ 110px) into a perfect circle?flex: 1; accomplish on the two action buttons inside .action-group { display: flex; }?position: relative; placed on .profile-card when the "Head Boy" status badge has position: absolute;?student-profile-card.html in your editor.In the next lesson, we will continue your web styling journey with Project 2: Simple School Club Landing Page (Beginner Projects).
👉 Continue to Next Lesson: Project 2: Simple School Club Landing Page →
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
| Previous Lesson | Next Lesson |
|---|---|
| Intro to Flexbox: The Modern 1D Layout Powerhouse | Project 2: Simple School Club Landing Page |
Test your understanding of this lesson with 5 questions. Each question has one correct answer.