Archived topic
H2 styling with additional image
5 replies · Started by Colin on November 21, 2020
I'd like to style my H2 with an image (a horizontal block under the H2 text). Is this possible? Any advice appreciated.
Hi there,
Not sure if I understand.
Can you link me to the page in question or provide a quick example of what you are after?
Let me know :)
Hi Leo,
Thanks for getting back to me. Here's an example:
https://www.skillpacks.com/wp-content/uploads/2020/11/H2-styling.jpg
Just a short blue line under my H2s, to give a little more visual appeal. (Presumably if there's a way to do this in GeneratePress it could be any image, but that's the look that I'm aiming for.)
Any advice much appreciated (and a code snippet would be golden!).
Thanks
Colin.
Hi there,
you can use some CSS like so:
.entry-content h2:after {
content: '';
display: block;
height: 5px;
width: 80px;
background-color: #f00; /* change color of line */
margin-top: 5px;
}
Brilliant! Thank you :)
You're welcome