I need a h2 that has a heavy stroke to the right of it. Like so:
I’m struggling with the best, responsive way to accomplish it. Not to mention that it’s in a custom WP theme, so I don’t want to create a ton of on page markup that the client will break immediately 🙂
What you need is a single element and an
:after
pseudo. P.S It’s responsive.Demo
Explanation: Here, the main part is to use
overflow: hidden;
on the element, and than am creating a virtual element using an:after
pseudo withcontent
property, and am positioning itabsolute
to the parent element which am setting torelative
Here you go with a fully responsive solution.
WORKING DEMO
The HTML:
The CSS:
Hope this helps.
PS: You can change the margin/padding accordingly to match your needs as well as media query requirements.