CHAPTER 1

image

Using CSS

There are three ways to insert CSS into an HTML document: by using an internal style sheet, inline styles, or an external style sheet. An internal style sheet applies to a single page, an inline style to a single element, and an external style sheet to potentially an entire web site.

Internal style sheet

An internal style sheet is useful when a single document needs to have its own unique styling. The style sheet is then embedded within the <head> section of the web document using the <style> element. This element is a container for style sheet rules and should have its type attribute set to "text/css".

<style type="text/css"> ...

Get CSS Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.