Skip to Content
Teach Yourself VISUALLY HTML and CSS, 2nd Edition
book

Teach Yourself VISUALLY HTML and CSS, 2nd Edition

by Guy Hart-Davis
September 2023
Beginner to intermediate
320 pages
10h 24m
English
Wiley
Content preview from Teach Yourself VISUALLY HTML and CSS, 2nd Edition

CHAPTER 8

Formatting Text with CSS

CSS enables you to format the text in your web pages to make them look the way you want. Basic formatting includes the font family, the font size and font weight, and the font color. More advanced formatting includes line height and letter spacing, superscripts and subscripts, and text shadows. You can also insert special characters and emojis in your pages.

image

Understanding Fonts and How to Use Them

Specify the Font Family

Set the Font Size and Font Weight

Adjust Line Height and Letter Spacing

Create Superscripts and Subscripts

Understanding Ways to Set Color in CSS

Set Font Color

Apply Text Shadows

Display Monospaced Font

Apply Text Decoration

Understanding HTML Entities

Insert Special Characters with HTML Entities

Insert Emojis

Using Custom Fonts on Web Pages

Understanding Fonts and How to Use Them

Working with fonts is a crucial part of web development, because fonts control the appearance of text on your web pages and can help convey your website’s message, tone, and style. CSS gives you a wide variety of ways to control fonts and text styling, from essential properties such as font family and font size to more specialized properties such as superscripts, subscripts, and text shadows.

This section gives you an overview of the font properties you can control. The following sections show you how to effect changes in the properties.

Font Families ...

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Head First HTML and CSS, 2nd Edition

Head First HTML and CSS, 2nd Edition

Elisabeth Robson, Eric Freeman
Practical HTML and CSS - Second Edition

Practical HTML and CSS - Second Edition

Brett Jephson, Lewis Coulson, Ana Carolina Silveira

Publisher Resources

ISBN: 9781394160686Purchase Link