text on color background - Forum | JoomShaper
Solved SP Page Builder

text on color background

Asked by stq74 2 years ago Last activity 2 years ago

Hello,
I created texts on a green background, with the first words in a larger font and on a black background.
Example: https://elodiebalandras.com/reportages-dessines
The problem is that depending on the browser, the black background exceeds the green background, I would like it to be aligned whatever the browser used.

Thank you

Accepted answer

Marked as the solution
Pavel
2 years ago · edited

Hi @stq74.

You cannot achieve this with the means that you are trying to do this. Inline elements do not support this. Only block or inline-block elements. You need to write your CSS for this.

Never use inline styles from text editor means for layout and design purposes.

Use both options - title and text.

Add your class to addon and write CSS code using this class

Code example (perhaps you need to adjust this code for your specific case)

.my-heading {
    background-color: green;
    color: white;
    padding: 10px 10px 3px;
}
.my-heading .sppb-addon-title {
    font-size: 1.9em;
    margin: -10px 10px 0 -10px;
    padding: 5px 10px 10px;
    background-color: black;
    float: left;
}
stq74 Asked this

Hi Pavel,
it's ok, thank you very much.

1 more reply

Mehtaz Afsana Borsha Staff

Hi

Thanks for contacting us. Could you please explain your issue a bit more? Because it seems same on my end in every browser and every device. If possible give me a screencast video please.

-Regards.

Log in to reply.