1. Developed By and When
The concept of CSS was proposed by Håkon Wium Lie in October 1994.
- Håkon Wium Lie was working at CERN and later at W3C (World Wide Web Consortium).
- He proposed CSS because web designers needed a way to separate content (HTML) from presentation
(style).
Before CSS, people used ugly, clunky HTML tags like
<font> , and table layouts
to handle visual design directly inside the HTML — it was messy and inflexible.
2. What is CSS?
CSS stands for Cascading Style Sheets — it controls the style and layout of web pages
(colors, fonts, spacing, positioning), separate from the HTML structure.
Why CSS related to W3C
- The W3C (World Wide Web Consortium) is an international organization founded by Tim Berners-Lee (the
inventor of the web) to standardize web technologies so that the web remains open, interoperable,
and universal.
- CSS was developed under W3C’s guidance, meaning:
- It became an official web standard, not controlled by a single browser company.
- W3C makes sure that browsers (like Chrome, Firefox, Safari) all implement CSS consistently, so
websites look the same across platforms.
Without W3C, we’d have a messy web where every browser might style things differently (like the old
browser wars of the 90s).
3. Types of CSS
CSS can be applied in three different ways:
- Inline CSS: Within HTML elements using the
style attribute.
- Internal CSS: Inside a
<style> tag in the HTML document’s
<head>.
- External CSS: In a separate file linked via
<link>.
4. Use Cases of CSS
CSS is used for:
- Layout Design: Grids, Flexbox, positioning, etc.
- Styling Text: Fonts, sizes, colors, and spacing.
- Responsive Design: Using media queries to adapt to screen sizes.
- Animations: Adding interactive effects with transitions and keyframes.
- Theming: Maintaining a consistent style across web pages.
5. What are Properties and Values?
In CSS, a property is a styling rule (like color), and a
value defines how that rule is applied (like blue).
CSS Cheatsheet
Example:
h1 {
color: blue;
font-size: 24px;
}
6. History of CSS
CSS was proposed in 1994 and CSS1 was released in 1996. Then came CSS2 (1998), and CSS3 (2001), which
introduced modular features like Flexbox, Grid, and animations.
7. Implementation of CSS in HTML
There are three main ways:
- Inline:
<p style="color:red;">
- Internal: Within
<style> tags in the <head>
- External: Via linked CSS file
Example (Internal CSS):
<head>
<style>
body {
background-color: #f4f4f4;
}
</style>
</head>
8. CSS Specificity
CSS specificity determines which rule wins when multiple CSS rules apply to the same element.
View in Detail