Introduction to CSS: The Makeup for HTML
CSS (Cascading Style Sheets) is a descriptive language that defines the look and feel of HTML elements. Unlike HTML, which focuses on semantics, CSS handles presentation, making it easier to maintain clean, styled websites.
Three Ways to Apply CSS to HTML
- Inline styles – Use the
styleattribute on HTML tags (not recommended; hard to maintain). - Internal styles – Add CSS inside a
<style>element within the same HTML document (better, but only works for one page). - External styles – Create a separate
.cssfile and link it to any HTML document using the<link>tag (preferred method for consistency across multiple pages). For a deeper dive into combining HTML and CSS effectively, check out the Comprehensive Guide to HTML and CSS: From Basics to Advanced Techniques.
Anatomy of a CSS Rule
- Selector – Targets the HTML element(s) you want to style.
- Declaration block – Enclosed in curly brackets
{}, containing one or more declarations. - Declaration – Consists of a property, a colon
:, a value, and a semicolon;.
Example:
h1 {
color: blue;
font-size: 24px;
}
Key Features to Master
1. CSS Properties (300+ Available)
Customize nearly every visual aspect:
- Layout – Control positioning and alignment. For advanced layout techniques like custom form controls, see Creating Custom Select Boxes with HTML and CSS: A New Browser Specification.
- Borders & backgrounds – Add visual separation and depth.
- Media queries – Adapt styles for different devices (responsive design).
- Transformations, filters, masking, clipping – Create advanced effects.
Properties can interact in unexpected ways, so experimentation is key.
2. The Cascade & Selector Specificity
“Cascading” means styles can come from multiple sources:
- Your custom CSS
- Browser default styles
- User-defined stylesheets (e.g., via Stylus or Stylish extensions)
Selector specificity determines which rule wins when conflicts arise. To debug, use your browser’s developer tools to see applied styles in order.
Getting Started with CSS
- MDN Learn Section – Official tutorials for hands-on practice.
- Browser DevTools – Inspect and tweak CSS live.
- CSS extensions – Stylus/Stylish to experiment with existing sites. A structured course like the Curso Completo HTML y CSS: Domina Desarrollo Web desde Cero can provide a comprehensive learning path in Spanish.
Quick Recap
- CSS is declarative, targeting HTML elements with selectors and applying style declarations.
- The cascade and specificity manage rule overrides.
- Start simple, master selectors and common properties, then explore advanced features. For those ready to add interactivity, the Complete JavaScript Beginner Course: Projects, Fundamentals, and API Integration is a great next step.
“It’s that simple! I can’t believe it!” – But with practice, you’ll unlock CSS’s full potential.
Hello! Welcome to this new episode of Web Demystified. Last time we talked about HTML, now it’s time to make it pretty so let’s talk about CSS. Like HTML, CSS is a descriptive language, but instead of defining a semantic for some text it defines the look and feel of each HTML element.
In other words, CSS is like makeup for HTML. You mean, like that? Who got that stupid idea!
So CSS is an acronym standing for Cascading Style Sheets. It's a technology that was introduced at the end of the 90's with the idea to create a clear distinction between text semantics and presentation. As the graphic abilities of browsers were growing,
using purely HTML to do both was making things more and more complicated up to the point HTML documents were… an awful random tag soup. Okay! How does it work in practice? We have three ways to apply CSS to an HTML document:
First, we can use the style attribute on any opening HTML tag. We usually tend to avoid that method as it lacks flexibility and makes things very, very hard to maintain. Second we can add CSS declarations within an HTML style element into any HTML document.
It makes things easier to maintain, but it's only good for a single HTML document and usually websites are made of several HTML documents. Third we can create a CSS file, a style sheet, that we can link to any HTML document with the HTML tag: <link> This is usually the preferred way to handle CSS as a single style sheet can be linked by several HTML documents.
This is how a website can have a consistent look & feel. Okay, that said, how are we turning this…. … into that?
What? Again! So a CSS rule looks like this
it starts with a selector to indicate which HTML element we want to style. Then we open a rule block using curly brackets Finally we write down individual declaration, each made of a property name, a colon, a property value and a semicolon.
From that point on it's all about targeting HTML elements with proper selectors and writing down a list of declarations to achieve the expected results. That sounds way too easy, where's the trap? Well…
From a syntactic point of view it's really that simple, however, like all web technologies, CSS brings many concepts and features that need to be learned and mastered. To be honest, CSS is so rich that web makers with 20 years of experience still discover new tricks everyday. In particular, there are two points worth discussing here.
The first one is the number of properties available. More than 300 at the time of shooting this video. I mean… All those properties are the true power behind CSS, they define everything you can tweak to custom the look and feel of your HTML document.
To give you a rough idea, with CSS you can: layout all your HTML documents in every ways possible; add borders and backgrounds to any boxes;
adjust your style based on the media it is displayed on; You can apply… transformations, filters, masking , clipping, to any content. There are so many properties, you can do so many things! Knowing them is important, at least the most common ones.
The mastering part comes from the fact, all those properties can interact with each other sometimes in very surprising ways. I mean really surprising! What the …
The other feature we need to discuss here is the cascade. Yeah, remember CSS stands for "Cascading" Style Sheets. CSS allows styles to be applied from various sources.
Usually it's just the style sheets you created, but there is always the default style sheet every browser is applying to all HTML documents. Also, browsers allow their users to create and apply their own style sheets to any HTML document of their choice! You wonder how to do this, check out the Stylus or Stylish web extension for your favorite browser. It is an excellent way to start fiddling with CSS.
The Cascade is the full set of rules that define in which order styles from various sources are applied and there are a lot of subtleties in here. One of the most common use of the cascade is the mastery of selectors There are many type of selectors that can be combined to target any element of your choice.
Sometimes different selector can target the same element. In such cases, CSS defines a set of rules to identify in which order each style should be applied to the element. Those rules are called selector specificity. I won’t get into the details of the specificity rules in here, just because MDN can give you that information way better than I could.
However, as a rule of thumb, if you open the CSS dev tools of your favorite browser, you'll notice that they display the CSS rules in the order they are applied. Using all those features is sometimes puzzling. However, the more you experiment the more you'll learn about them… and to make your life easier with all of that I can only suggest you to do some reading on MDN
Okay! Let's recap. CSS is a declarative language that allows you to define the look and feel of HTML elements. Style rules target HTML elements with selectors and they applied visual effects defined by style declarations.
The cascade allows to override and combine those rules. Yes, it’s that simple! I can't believe it! This has to stop!
Thank you all for watching this video. if you want to know more and start fiddling with CSS I highly suggest you have a look at the MDN learn section. if you enjoyed that episode, feel free to like it and to share it with your friends… They will thank you for that If you want to continue the discussion feel free to comment below or join me and my colleagues on Twitter
And finally… Long live the open web, see you next time!
CSS (Cascading Style Sheets) is a descriptive language that controls the visual presentation of HTML elements, such as colors, layouts, and fonts. It separates content structure from design, making websites easier to maintain and update, while enabling consistent styling across multiple pages.
The three methods are inline styles (using the style attribute), internal styles (within a <style> tag in the HTML), and external styles (a separate .css file linked via <link>). External styles are the most effective for consistency and maintenance, as they allow you to reuse CSS across multiple pages.
A CSS rule consists of a selector (targeting HTML elements) and a declaration block enclosed in curly brackets {}. Inside, each declaration pairs a property with a value (e.g., color: blue), separated by a colon and ending with a semicolon. For example, h1 { color: blue; font-size: 24px; } styles all <h1> headings with blue text and 24px font size.
Beginners should start with core properties for layout, borders, backgrounds, and typography, then explore media queries for responsive design. Also, learn to use browser DevTools to inspect and tweak styles live, and experiment with advanced features like transformations and filters as you progress.
The cascade means styles can come from multiple sources (your CSS, browser defaults, or user stylesheets), and specificity determines which rule wins when conflicts occur. For example, an ID selector (#header) overrides a class selector (.title). Use browser DevTools to debug and see which styles apply in order.
Start with the MDN Learn section for official tutorials, and use browser DevTools to practice live editing. For hands-on experimentation, try CSS extensions like Stylus. For a structured path, consider courses like 'Curso Completo HTML y CSS' for Spanish speakers or pair CSS learning with JavaScript via a beginner course.
Begin by mastering selectors and common properties using an external stylesheet. Practice with simple projects, then explore the cascade and specificity with DevTools. As you gain confidence, dive into media queries, animations, and layout systems. The key is to experiment and build progressively to unlock CSS's full potential.
Keep this summary
Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.
Save to LunaNotesOr summarise for another video.
This summary and transcript were automatically generated using AI with the Free YouTube Transcript Summary Tool by LunaNotes.
Related summaries
HTML Basics Explained: HyperText Markup Language for Beginners
Understand the fundamentals of HTML, the oldest language of the web. This video breaks down how HTML uses tags to structure text, create hyperlinks, and define web content, with practical tips for beginners to start coding confidently.
Comprehensive Guide to HTML and CSS: From Basics to Advanced Techniques
This video series provides a thorough introduction to HTML and CSS, covering everything from the foundational elements of web development to advanced styling techniques. Learn how to create structured web pages, style them effectively, and implement interactive features using HTML and CSS.
Creating Custom Select Boxes with HTML and CSS: A New Browser Specification
Discover how to create custom select boxes using only HTML and CSS with the new browser specification. This video tutorial by Kyle from Web Dev Simplified walks you through the process, showcasing the simplicity and flexibility of this innovative feature.
Implementing Your Own Design System in Next.js
Learn how to efficiently create a reusable design system in Next.js using Tailwind CSS and other modern tools.
Complete JavaScript Beginner Course: Projects, Fundamentals, and API Integration
Learn JavaScript from scratch with practical projects including a digital clock, calculator, game, image slider, and a weather app fetching live data from APIs. This comprehensive course covers essential concepts like variables, functions, loops, objects, DOM manipulation, asynchronous programming, and more to build interactive web applications.
Most viewed summaries
A Comprehensive Guide to Using Stable Diffusion Forge UI
Explore the Stable Diffusion Forge UI, customizable settings, models, and more to enhance your image generation experience.
Kolonyalismo at Imperyalismo: Ang Kasaysayan ng Pagsakop sa Pilipinas
Tuklasin ang kasaysayan ng kolonyalismo at imperyalismo sa Pilipinas sa pamamagitan ni Ferdinand Magellan.
Mastering Inpainting with Stable Diffusion: Fix Mistakes and Enhance Your Images
Learn to fix mistakes and enhance images with Stable Diffusion's inpainting features effectively.
Pamamaraan at Patakarang Kolonyal ng mga Espanyol sa Pilipinas
Tuklasin ang mga pamamaraan at patakaran ng mga Espanyol sa Pilipinas, at ang epekto nito sa mga Pilipino.
How to Install and Configure Forge: A New Stable Diffusion Web UI
Learn to install and configure the new Forge web UI for Stable Diffusion, with tips on models and settings.
Found this summary useful?
Take it with you. One click puts it in your own LunaNotes library.
Save to LunaNotes