Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indenting only the first line of text in a paragraph?

I have several paragraphs that I would like to indent, although only the first lines of these paragraphs.

How would I target just the first lines using CSS or HTML?

like image 708
Miles Henrichs Avatar asked May 02 '11 12:05

Miles Henrichs


People also ask

What does it mean to indent the first line of a paragraph?

A first-line indent is the most common way to signal the start of a new paragraph. The other common way is with space between paragraphs. First-line indents and space between paragraphs have the same relationship as belts and suspenders. You only need one to get the job done.

How do I stop Word from indenting second line of paragraph?

Highlight the text that has a hanging indent. Right click your mouse. Select Paragraph from the resulting pop up menu. Under Indentation, use the Special pull-down menu to select (none) and your done!

Should I indent first line of a paragraph?

As remarked above, the first paragraph after a title or section heading is not indented. Every succeeding paragraph should be indented; the tab key on any keyboard will do this for you. For certain kinds of writing, such as technical reports and business letters, there is another format which is sometimes preferred.

How do I automatically indent the first line of a paragraph in Word?

This can be found in the "Indents and Spacing" tab. Click the drop down menu under "Special". Select "First Line" to automatically indent the first line of each new paragraph. Enter the indent size.


2 Answers

Use the text-indent property.

p {     text-indent: 30px; } 

jsFiddle.

like image 51
alex Avatar answered Sep 25 '22 07:09

alex


In addition to text-indent, you can use the :first-line selector if you wish to apply additional styles.

p:first-line {     color:red; }  p {     text-indent:40px; } 

http://jsfiddle.net/Madmartigan/d4aCA/1/

like image 20
Wesley Murch Avatar answered Sep 24 '22 07:09

Wesley Murch