I am working on a WordPress blog, and I am trying to figure out how to add horizontal lines on each side of some of my titles like the ones in this link:
In the blog above, titles in the sidebar, and the ‘share this article’ title has the desired effect that I am looking for, but can’t seem to figure out how to get it. I know the basics of HTML and CSS, so this could be something that I am simply overlooking or just haven’t learned yet.
Also, is there a way to take this type of styling to the next level by adding more unique types of lines (like long curly lines) through CSS?
Thanks in advance!
use
:before
or :afterExample 1:
Example 2
Using your browser’s developer tools, inspect the
span
elements containing those titles. You’ll see:before
and:after
CSS3 selectors in which some positional/border styling is used.Can you use other kinds of lines? Sure — CSS3 would allow you to use a wide variety of things, but the list is probably too long to list here on SO.