Skip to ContentMini Arrow Down Icon
  • Codecademy Logo
  • Codecademy Logo
@font-face
font
font-family
font-size
font-style
font-weight
letter-spacing
line-height
text-align
text-decoration
text-indent
text-justify
text-overflow
text-shadow
text-transform
word-spacing
Back to CSS
  1. Docs/
  2. CSS/
  3. Typography/
  4. line-height

line-height

Open IconEdit on GitHub

Set the vertical spacing between lines of text.

Syntax

line-height: <line-height-value>;

The line-height-value do not accept negative value. The line-height-value can be in any CSS units such as:

  • px
  • rem
  • em
  • %

Example 2

Set the line height on p tag to 10px:

p {
line-height: 10px;
}

Contributors

  1. net8535613879's avatar'
    net8535613879
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
Open IconEdit on GitHub

Learn CSS on Codecademy

Career path

Full-Stack Engineer

A full-stack engineer can get a project done from start to finish, back-end to front-end.
Checker Dense
Includes 51 Courses
Checker Dense
Certificate Icon
With Professional Certification
Checker Dense
Level Icon
Beginner Friendly
169 Lessons
Career path

Front-End Engineer

Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
Checker Dense
Includes 34 Courses
Checker Dense
Certificate Icon
With Professional Certification
Checker Dense
Level Icon
Beginner Friendly
131 Lessons
Free course

Learn CSS

In this CSS tutorial, you’ll learn how to add CSS to visually transform HTML into eye-catching sites.
Checker Dense
Level Icon
Beginner Friendly
8 Lessons
Open IconEdit on GitHub

Contributors

  1. net8535613879's avatar'
    net8535613879
    net8535613879's avatar'
    net853561387924 contributions

Company

  • About
  • Careers
  • Affiliates
    • Twitter Icon
    • Facebook Icon
    • Instagram Icon
    • Youtube Icon

Resources

  • Articles
  • Blog
  • Cheatsheets
  • Code challenges
  • Docs
  • Projects
  • Videos
  • Workspaces

Support

  • Help Center

Resources

  • Articles
  • Blog
  • Cheatsheets
  • Code challenges
  • Docs
  • Projects
  • Videos
  • Workspaces

Support

  • Help Center

Plans

  • Paid memberships
  • For students
  • Business solutions

Community

  • Forums
  • Chapters
  • Events
  • Discord

Codecademy from Skillsoft

Codecademy from Skillsoft

Subjects

  • AI
  • Cloud Computing
  • Code Foundations
  • Computer Science
  • Cybersecurity
  • Data Analytics
  • Data Science
  • Data Visualization
  • Developer Tools
  • DevOps
  • Game Development
  • IT
  • Machine Learning
  • Math
  • Mobile Development
  • Web Design
  • Web Development

Languages

  • Bash
  • C
  • C++
  • C#
  • Go
  • HTML & CSS
  • Java
  • JavaScript
  • Kotlin
  • PHP
  • Python
  • R
  • Ruby
  • SQL
  • Swift

Career building

  • Career paths
  • Career services
  • Interview prep
  • Professional certification
  • —
  • Full Catalog
  • Beta Content
  • Roadmap

Mobile

  • Download on the App Store
  • Get it on Google Play

Mobile

  • Download on the App Store
  • Get it on Google Play
  • Privacy Policy
  • Cookie Policy
  • Do Not Sell My Personal Information
  • Terms
Made with ❤️in NYC © 2023 Codecademy