Embedded style sheets

Instead of using the best type of style sheet, the external style sheet, we can also write our rule sets in the head of HTML documents. This is called an embedded style sheet. There are plenty of reasons for not doing it this way. The main two reasons are that it hampers the workflow, and it only controls a single page of the site. What we would do is simply create somewhere in the head tag, these open and close <style> tags:

<head>  <style> 

  </style> </head>

Anywhere inside this open <style> tag we can start adding our rule sets, which will only affect this one page:

<head>  <style> 
    h2 { 
      font-size: 50px;    } 
  </style> </head>

Again, this isn't the most preferred place to write your styles. Keeping them in an external style ...

Get Mastering CSS 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.