HTML & CSS Interview Question #51
What is CSS and what is its role in web development?
CSS Fundamentals, Selectors, Cascade, Specificity, Box Model, Units & Typography Mid-Level Intermediate
Quick Interview Answer
CSS stands for Cascading Style Sheets. It controls the presentation and layout of HTML content, including colors, spacing, typography, sizing, positioning, responsive behavior, and visual states.
Detailed Explanation
CSS stands for Cascading Style Sheets. It controls the presentation and layout of HTML content, including colors, spacing, typography, sizing, positioning, responsive behavior, and visual states.
A good separation of concerns keeps HTML focused on structure and semantics while CSS controls presentation. Modern CSS can also handle sophisticated layouts, animations, responsive design, custom properties, and component styling without requiring JavaScript for every visual change.
Code Example
<h1 class="page-title">Interview Preparation</h1>
<style>
.page-title {
color: #1f2937;
font-size: 2rem;
margin-bottom: 1rem;
}
</style>