If you're interested, here's another way to accomplish the effect without requiring the wrapper elements, so you can just add the line-before class to any block text element (paragraph, headings, etc).
<!-- html -->
<h2 class="line-before">This is a headline</h2>
<p class="line-before">Hello. This is a paragraph</p>
When you attach the line-before class to a multiline text block using the css above, the entire text block will be indented, and the line will be positioned at 50% of the text block's full height.
You could also tweak the CSS so that only the first line of a multiline text block will be indented:
No worries, glad it was helpful. I have a bit of an obsession with keeping my html as sparse as possible. Modern CSS can accomplish an incredible amount with very minimal tags to hook onto.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice effect.
If you're interested, here's another way to accomplish the effect without requiring the wrapper elements, so you can just add the
line-before
class to any block text element (paragraph, headings, etc).When you attach the
line-before
class to a multiline text block using the css above, the entire text block will be indented, and the line will be positioned at 50% of the text block's full height.You could also tweak the CSS so that only the first line of a multiline text block will be indented:
Wow.. Thanks
Why didn't I think of this
I'll definitely update this on the original article...
Thanks
No worries, glad it was helpful. I have a bit of an obsession with keeping my html as sparse as possible. Modern CSS can accomplish an incredible amount with very minimal tags to hook onto.