Skip to Content
Practical Web Design
book

Practical Web Design

by Philippe Hong
April 2018
Beginner content levelBeginner
368 pages
7h 37m
English
Packt Publishing
Content preview from Practical Web Design

The different ways to use CSS

There are three ways to use CSS:

  •  Inside an HTML tag with a style attribute (this method is not recommended, but you can still use it a little bit): 
<p style'"font-size:12px"></p>
  • Inside our <head> section in an HTML document with the tag <style>:
<style>  p {    font-size:12px;  } </style>
  • CSS code can also be put into an external file, linked to the HTML document with the tag <link>. The file extension will be saved as a .css file:
<link rel="stylesheet" href="css/style.css">

For this example, we will use the second option, but we'll learn the third option when we start building our own website.

Let's start by adding the <style> tag in our <head> section:

<head> <!--This is our head tag where we put our title ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Web Design Playground

Web Design Playground

Paul McFedries
Hello Web Design

Hello Web Design

Tracy Osborn
The Principles of Beautiful Web Design, 4th Edition

The Principles of Beautiful Web Design, 4th Edition

Jason Beaird, Alex Walker, James George

Publisher Resources

ISBN: 9781788395038Supplemental Content