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?
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.
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!
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.
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.
Use the text-indent
property.
p { text-indent: 30px; }
jsFiddle.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With