Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of line-height, and what does white-space:nowrap do?

Tags:

css

what's line-height supposed to do since there is already an attribute called font-size?

And what does it mean when we specify something like:

white-space:nowrap;
like image 741
omg Avatar asked Jun 24 '09 20:06

omg


People also ask

What does whitespace Nowrap do?

nowrap : Multiple whitespaces are collapsed into one, but the text doesn't wrap to the next line.

What is the purpose of the line height attribute?

The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text. On block-level elements, it specifies the minimum height of line boxes within the element.

Why is white space important in HTML?

Whitespace is any string of text composed only of spaces, tabs or line breaks (to be precise, CRLF sequences, carriage returns or line feeds). These characters allow you to format your code in a way that will make it easily readable by yourself and other people.

What is white spacing?

White space, also known as “negative space,” is empty space around the content and functional elements of a page. The basic role of white space is to let your design breathe by reducing the amount of text and functional elements that users see at once.


1 Answers

The line-height property allows you to set the height of a line of text independently from the font size (works well for centering a single line of text vertically, etc.)

white-space:nowrap; will for lines of text not to wrap until a <br /> is encountered.

like image 83
Justin Niessner Avatar answered Oct 21 '22 00:10

Justin Niessner