Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape

CSS Text Spacing

CSS Text Spacing

CSS CODES & EXAMPLES

CSS Text Spacing

Learn how to control the spacing between letters, words, lines and paragraphs using CSS. Create clean, readable and professional typography for modern websites.

01

What is Text Spacing?

Control the space around text

CSS provides several properties for controlling the spacing and readability of text. You can increase or decrease the space between letters, words and lines and also control the indentation of paragraphs.

Important Properties: letter-spacing word-spacing line-height text-indent
02

letter-spacing

Control the space between characters

The letter-spacing property controls the horizontal space between individual characters.

letter-spacing.css
h2 {
  letter-spacing: 3px;
}

CSS TEXT SPACING

03

Positive Letter Spacing

Increase the space between letters
Normal

Computer Education

2px

Computer Education

5px

Computer Education

04

Negative Letter Spacing

Reduce the space between letters

A negative value can bring characters closer together.

negative-spacing.css
h1 {
  letter-spacing: -1px;
}

SNCEC

05

word-spacing

Control the space between words

The word-spacing property controls the amount of horizontal space between words.

word-spacing.css
p {
  word-spacing: 10px;
}

Learn Computer Courses Online

07

Compare Line Heights

See the difference in readability
1.0

Learn computer skills with practical examples and structured lessons designed for beginners.

1.5

Learn computer skills with practical examples and structured lessons designed for beginners.

2.0

Learn computer skills with practical examples and structured lessons designed for beginners.

08

text-indent

Add indentation to the first line

The text-indent property specifies how much the first line of a paragraph should be indented.

text-indent.css
p {
  text-indent: 40px;
}

CSS text indentation can be useful for articles, educational content and long-form text. It creates a visual starting point for each paragraph and can improve the structure of written content.

09

Spacing in Headings

Create professional typography
CSS COURSE

CSS Text Spacing

Create clean and readable website typography.

heading-spacing.css
.label {
  letter-spacing: 2px;
}

h2 {
  letter-spacing: -0.5px;
}

p {
  line-height: 1.7;
}
10

Navigation Menu Spacing

Improve menu readability
navigation-spacing.css
.navigation a {
  letter-spacing: 1px;
  word-spacing: 2px;
}
11

Button Text Spacing

Create clear call-to-action buttons
button-spacing.css
button {
  letter-spacing: 1px;
  word-spacing: 2px;
}
12

Course Card Typography

Practical education website example
FEATURED COURSE

Diploma in Computer Application

Learn computer fundamentals, Microsoft Office, internet, digital services and practical computer applications with structured lessons and hands-on activities.

6 Months View Course
13

Combining Text Spacing Properties

Use multiple properties together

Text spacing properties can be combined to create a complete typography system for headings, labels, paragraphs and buttons.

See also  CSS Justify Content

LEARNING RESOURCES

Build Your Digital Skills

Develop practical computer skills through structured lessons, examples, projects and exercises.

combined-spacing.css
.label {
  letter-spacing: 2px;
}

.title {
  letter-spacing: -0.5px;
}

.description {
  word-spacing: 2px;
  line-height: 1.8;
}

.button {
  letter-spacing: 1px;
}
14

Best Practices

Use spacing for readability
✓ Use line-height for paragraphs

A comfortable line height makes long-form content easier to read on desktop and mobile devices.

✓ Use letter-spacing carefully

Small positive spacing works well for labels and uppercase navigation text.

✓ Avoid excessive spacing

Too much spacing can break visual hierarchy and make text difficult to understand.

✓ Test responsive layouts

Text spacing should remain comfortable on mobile screens as well as larger displays.

15

Practice Task

Test your CSS Text Spacing skills

🎯 Your Challenge

Create a professional course card using CSS text spacing.

  • Use letter-spacing for the course label.
  • Use line-height for the description.
  • Use word-spacing in a paragraph.
  • Use text-indent in an article paragraph.
  • Apply spacing to a navigation menu.
  • Apply letter spacing to a button.
16

CSS Text Spacing Live Runner

Experiment with CSS spacing properties
LIVE PREVIEW
17

Quick Reference

Important properties at a glance
letter-spacing Controls the space between characters.
word-spacing Controls the space between words.
line-height Controls the vertical distance between lines.
text-indent Controls the indentation of the first line.
`;document.getElementById( "sncecSpacingPreview" ).srcdoc=html;}document.addEventListener( "DOMContentLoaded", function(){sncecSpacingRun();} );

Html Codes

  • 16/08/2026

CSS Flex Shrink

  • 19/08/2026

Leave a Reply

Your email address will not be published. Required fields are marked *