So im trying to add a line behind/under my text which i have partially manged to do (see attached.)
To get the above outcome i added the following code into the :after section of the Divi theme’s text module custom css option:
content: '';
position: absolute;
bottom: 15px !important;
left: 6px;
right: -10px;
height: 13px;
background: #25c6fe;
width: 19.8%;
I have two problems:
- When saving the page it puts the line underneath the text.
- If i center the text the line stays to the left
How can i fix these probelms? I assume the css is wrong?
3
Answers
It might result in a unnecessary complex css code, if you try to use
:after
to make your desired styling. Starting with thewidth
property, which should always have the length of the element, because you want the whole text to be underlined, no matter how long it is. So I would suggest you try using thebackground-image
property to make things work:With the transparent percentage value, you can set the height of the line. Use less percent, if you want the line to have more height. Looking at your image, I think something like
linear-gradient(180deg, transparent 70%, #25c6fe 0)
could be what you want to achieve.Ok get rid of that whole class and styles and everything about it that you made for that underline bar and do it this way by only adding to your
.et_pb_text_1
CSS. Add thisborder-bottom: 10px solid #25c6fe
and display it as a table-cell.so like this:
Here you can try:
Hope it works. 🙂