热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

Chapter 3

Colors, Backgrounds, Borders, Units, and Sizing Foundations

Build visual styling basics with color systems, size units, borders, backgrounds, and practical interface sizing decisions.

Inside this chapter

  1. Working with Color
  2. Background Styling
  3. Borders and Rounded Shapes
  4. Common CSS Units
  5. Width, Height, min and max Constraints
  6. Business Example

Series navigation

Study the chapters in order for the clearest path from CSS basics and styling foundations to advanced layout, responsive design, architecture, and maintainable interface systems. Use the navigation at the bottom to move smoothly through the full tutorial series.

Tutorial Home

Chapter 3

Working with Color

.button {
  background-color: #1f6feb;
  color: white;
}

CSS supports named colors, hex values, RGB, RGBA, HSL, and more. Students should learn color not only as decoration, but as part of hierarchy, state, contrast, and usability.

Chapter 3

Background Styling

.hero {
  background: linear-gradient(135deg, #f0f7ff, #ffffff);
}

Backgrounds can use solid colors, gradients, images, and layered effects. They shape atmosphere and readability, especially on modern responsive pages.

Chapter 3

Borders and Rounded Shapes

.card {
  border: 1px solid #d0dbe7;
  border-radius: 16px;
}

Borders help define boundaries, group elements, and communicate component structure. Border radius can soften or sharpen the overall visual tone.

Chapter 3

Common CSS Units

  • px for fixed pixel-based sizing
  • % for relative sizing based on parent context
  • em and rem for scalable typography and spacing
  • vw and vh for viewport-relative measurements
Chapter 3

Width, Height, min and max Constraints

Strong layout design often relies on min-width, max-width, min-height, and related constraints so content remains readable and stable across screens.

Chapter 3

Business Example

A pricing card may need a clear border, strong contrast, consistent width, and background treatment that separates it from surrounding content. Small CSS decisions here strongly affect user perception and conversion behavior.

版权所有 © 2026,WithoutBook。