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

CSS formatting

We're now ready to put in our CSS, so how's the formatting in CSS?

CSS is pretty simple to understand:

  • The selector: This is where you choose which HTML elements you want to add style to. In this example, we select all the <h1> elements.
  • Curly bracket: All styles inside these will apply to the HTML elements chosen by the selector
  • Property: A property controls one aspect of an HTML element's style, such as text-align, color, width, background, and so on.
  • Value: The value goes to the property. In this case, the text-align value could be left, right, center, or justify.
  • Semicolon: It is mandatory to apply it at the end of a property.  

You can have multiple styles in the same <style> tag. Let's center all the h1 and p tags. ...

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