CSS Links & Media

Style links, states, and responsive media; pair with media queries for adaptive layouts.

Introduction to CSS Links & Media

Theory: Links should be visually clear in every state (default, hover, focus, visited). Consistent link styling improves navigation confidence.

What You'll Learn:

Learn how to style links, embedded media, icons, and interactive states using clean CSS patterns.

Links and media are key interaction points in UI. Good CSS styling improves clarity, accessibility, and engagement.

Responsive Media Styling

Theory: Responsive media styling keeps embedded content stable across devices. Aspect ratio and overflow handling prevent layout shifts.

ElementCommon CSSPurpose
imgmax-width:100%; height:auto;Prevents overflow on small screens
videowidth:100%; border-radius:12px;Responsive media with modern UI
iframeaspect-ratio:16/9; width:100%;Responsive embeds (YouTube/maps)
figuremargin:0;Cleaner image + caption alignment

Icon and Social Link Styling

Theory: This topic explains practical CSS concepts used in real interfaces. Understanding the theory helps you choose the right properties and patterns.

Icon Circle Example:
.social-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #0f172a;
}
.social-link:hover {
    background: #0d6efd;
    color: #fff;
}
Sample Output: The example produces a clean, modern UI pattern with responsive behavior and better readability.