Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show first line of a paragraph

Tags:

html

jquery

css

I have a DIV with a multi-line paragraph.

Is there any way (maybe using jQuery) to only show the first line of the paragraph and hide the others?

like image 982
Victor Avatar asked Oct 19 '10 02:10

Victor


People also ask

What is a first line?

Definition of first-line : being the preferred, standard, or first choice first-line treatment of tuberculosis — compare second-line.

Can I use :: first line?

The ::first-line selector is used to add a style to the first line of the specified selector. Note: The following properties can be used with ::first-line: font properties. color properties.

What is a first line indent?

With a first line indent, the first line of a paragraph is indented more than the other lines in the paragraph. Use the tab key to create a first line indent in Word for the web.


1 Answers

Here is a way (sort of) by making the paragraph white-on-white except the :first-line of it: http://jsbin.com/usora4/2/edit

Snippet of CSS:

p { color: white; }
p:first-line { color: black; }
like image 176
Chris Coyier Avatar answered Oct 04 '22 04:10

Chris Coyier