KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How to select and apply style on a specific line of text? Like the CSS pseudo-element :first-line , but I want to select any line, not limited to the first. It seems that it can't be done by using only CSS... Anyway I don't mind a JS solution. Update: Well, actually it's only for interest. I'm trying to achieve something like highlighting every even row of a paragraph (for readability, like what everyone does for table rows)... Pre-formating the text like: <p> <span class='line1'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do </span> <span class='line2'>eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad </span> <span class='line3'>minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip </span> <span class='line4'>ex ea commodo consequat. Duis aute irure dolor in reprehenderit in </span> <span class='line5'>voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur </span> <span class='line6'>sint occaecat cupidatat non proident, sunt in culpa qui officia </span> <span class='line7'>deserunt mollit anim id est laborum.</span> </p> ...it is ok for me, but how to know where to split? Even if the width of paragraph is given, it is still hard to determine...
Tags (comma-separated)
Save Edits
Cancel