CET138 Full Stack Development โ Assignment 1 | Styling & Layout Mastery
CSS controls the visual presentation of web pages โ layout, colors, typography, animations, and responsive behavior. This section demonstrates core CSS concepts with live, interactive examples.
Inline: <p style="color:red;"> โ This text uses inline color.
Internal / External: Best practice uses external stylesheets. This page uses internal & external concepts (embedded & global).
<link rel="stylesheet" href="styles.css"> โ external (reusable)
๐ต This paragraph uses a class selector (.example).
๐ข This uses an ID selector (#unique-selector-demo) โ border left accent.
๐ Descendant selector: inside a div โ targeted by .demo-container p.
Every element is a rectangle: content โ padding โ border โ margin.
โจ Hover items โ translateY & shadow. Flex properties: justify-content: center; flex-wrap: wrap;
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) โ responsive columns.
โฌ๏ธ Button uses transition on hover (background, letter-spacing, scale). Circle uses @keyframes pulseGlow infinite.
:root {
--primary-color: #1a1a2e;
--accent-color: #e94560;
--border-radius: 20px;
}
var(--accent-color) and var(--border-radius) from root.โ CSS variables allow dynamic theming and easy maintenance.
::before adds an emoji on hover; :hover changes background & padding.
Other pseudo-classes: :first-child, :nth-of-type, :focus (input focus effects).
Media queries apply different styles at breakpoints (e.g., @media (max-width: 680px)). This portfolio also adapts navigation, padding, and grid layout on mobile.
Current viewport indicator: Resize to see change
CSS rules are applied based on specificity: inline > ID > class > element. Important: !important overrides, but use sparingly.
This paragraph has inline color: green but also a class? Inline wins.
โ Result: Inline style (> class) makes text green. Demonstrates cascade priority.
๐ก CSS brings life to HTML and is essential for front-end and full stack developers. This page demonstrates layout models, animations, responsiveness, and modern techniques used in real-world projects.
โฌ Back to top