Skip to content

Week 2 Day 2

New Terms

  • Inline Style
  • Style Block
  • External CSS

Inline Style

An inline style in CSS is used to apply styling directly to an HTML element. It's done by adding the style attribute right within the element’s opening tag. While this method is super quick and convenient for small changes, it’s not the most efficient for maintaining larger websites since it requires going through each individual element.

Style Block (Internal CSS)

A style block (also known as internal CSS) involves adding CSS rules within the "style" tag inside the "head" section of your HTML document. This is a great option when you want to apply styles across the entire page but don’t want to create a separate external stylesheet. It keeps everything in one file, which can be convenient for small websites or single-page projects.

External CSS

External CSS is the most scalable approach. It involves creating a separate .css file that contains all of your styles. This file is linked to your HTML documents through a "link" tag in the "head" section. This method keeps the HTML clean, and the CSS reusable across multiple pages, making it ideal for larger websites.

image of examples of inline,internal, and external css