I am looking to left-align the text in a button instead of it being in the center. I added
text-align: left;
to my css for the button, but it still isn’t working.
Does anyone know how to get it to work without having to use an image?
I am looking to left-align the text in a button instead of it being in the center. I added
text-align: left;
to my css for the button, but it still isn’t working.
Does anyone know how to get it to work without having to use an image?
Hi Morgan,
The custom css that you need to use will need to reference the " label" element of the button. The script below should work for you.
<br />#button-id .label {<br /> text-align: left;<br />}<br />
Just replace button-id with the actual id of the button whose text you are trying to alter.
A couple of things to note,
Nicely explained Andre!!
Thanks for the response, Andre! Sorry, I didn’t include the entire CSS originally, since it’s actually a pretty long one. My bad…
<br />#lp-pom-button-53 {<br /> position: absolute;<br /> display: inline-block;<br /> margin: 0 0 0 0;<br /> padding: .6rem 3.2rem .4rem 1.5rem;<br /> background: #910048;<br /> border: 0;<br /> -webkit-appearance: none;<br /> -moz-appearance: none;<br /> cursor: pointer;<br /> color: black;<br /> line-height: 2.3;<br /> font-family: 'Sanchez W03', Rockwell, "Lucida Bright", slab-serif, serif;<br /> font-weight: 300;<br /> text-align: left;<br /> text-decoration: none;<br /> overflow:hidden; }
And it’s still not working even after publishing.
Hey Morgan,
The instruction should still hold true for the complete code that you’ve provided above.
In your custom CSS, you are only referencing the Button ID which is #lp-pom-button-53
To style the text on the button, you also need to include the " label" element of the button in your script, which controls the style of the text.
So all you’ll need to do is change
#lp-pom-button-53 {
to
#lp-pom-button-53 .label {
The rest of your CSS can remain the same.
This worked! Thank you!
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.