-
AuthorPosts
-
December 9, 2015 at 12:45 pm #699600
Hi Support,
I’ve searched the forum, found and tried related posts, but still need your help. Here’s my situation:
Client would like that buttons site wide have 3 different color and styles depending actions: 1 for normal button (green font on white background), 1 for mouse-over (white font on green background) [until there no problem] … and 1 when clicking on the button (white font on blue background).
Could you tell me how to do this last part (clicking)?
Thank you in advance,
GianniDecember 9, 2015 at 4:53 pm #699957Hi there,
Thanks for posting in.
This should able to help you, https://community.theme.co/kb/implementing-additional-button-colors/
Basically, you have to do it similar to :hover, but as :active. Like this,
.x-btn.my-btn:active { color: #ffffff; border-color: #600900; background-color: #ef2201; -webkit-box-shadow: 0 0.25em 0 0 #a71000, 0 4px 9px rgba(0, 0, 0, 0.75); box-shadow: 0 0.25em 0 0 #a71000, 0 4px 9px rgba(0, 0, 0, 0.75); }
You may also provide your url in question, we could check it and provide more exact css.
Thanks!
December 10, 2015 at 10:17 am #701176This reply has been marked as private.December 10, 2015 at 5:09 pm #701669Hi There,
Try adding this in your customizer’s custom CSS:
.x-btn:active{ color: #ffffff; background-color: #1f82c0; }
Let us know how it goes.
Thanks.
December 15, 2015 at 1:22 pm #707968Hi Support,
I have two other questions related to buttons.
1) I want to get rid of global button text shadow. I add this code found on the forum:question 1 solved.
.x-btn, .x-btn:hover, .button, .button:hover, [type=”submit”], [type=”submit”]:hover{
text-shadow:none;
-moz-text-shadow:none;
-webkit-text-shadow:none;
}
but nothing happened. where am I wrong?
2) I want to add a new button with different style than the global one (flat, large, white font and blue background). I red the thread on Implementing Additional Button Colors but I do not understand where I should put [button class=”my-btn” href=”#” title=”Title”]. Should I use it a text element instead of a button element? I am a bit lost as you can imagine coding is not my cup of tea.
Thank you in advance for letting me know.
Best,
GianniDecember 15, 2015 at 4:26 pm #708210Hello Gianni,
1.) Please change above CSS to this:
.x-btn, .x-btn:hover, .button, .button:hover, [type="submit"], [type="submit"]:hover{ text-shadow:none !important; -moz-text-shadow:none !important; -webkit-text-shadow:none !important; }
There’s a more specific CSS that was overriding your custom code, adding !important will make sure that it will be applied.
2.) Please note that there are two ways to use an element. Either a shortcode or the element in Cornerstone. If you prefer shortcode, you have to insert the shortcode inside Raw Content element or Text element inside Cornerstone. Then there’s a button element on Cornerstone.
The example on this article:https://community.theme.co/kb/implementing-additional-button-colors/ is a button shortcode. Add a Raw Content element or Text element in Cornerstone and copy
[button class="my-btn" href="#" title="Title"]
On the other hand, you may use Button element directly. Then on the class field, add your custom button class like my-btn on the sample link.
They are the same. Just different way of implementation.
Hope this helps.
December 16, 2015 at 11:51 am #709454Hi Support,
Point 1: works fine now … thank you very much!
Point 2: Buttons were inserted by using Button element directly: therefore I add my-btn on the class field and add in customizer this sample code from the article you mentioned, but nothing happened 🙁
.x-btn.my-btn {
color: #1F82C0;
border-color: #ac1100;
background-color: #ff2a13;
}.x-btn.my-btn:hover {
color: #0A2C40;
border-color: #600900;
background-color: #ef2201;
}any guess why?
Gianni
December 16, 2015 at 11:54 am #709459well, never mind Guys,… if I do not save it it won’t work of course:::
December 16, 2015 at 12:12 pm #709502Good to hear you figured it out! Let us know if you have any other questions. 🙂
-
AuthorPosts