I want to add call-to-action box in my sidebar. I have created a block. How do I convert a mailto: into a button? In other words; how do I apply the class "Button" to the link? Got that sorted.
Now, to get it to show an icon with .email:before, that's another thing ...
Update: I figured it out, and here's how for other happy css amateurs like me:
1. Here's how I added a class to a link: in my CKEditor, I marked the text to create a hyperlink. In the advanced settings, write "Button" (without quotes) in the Stylesheet classes field. Save it. You will now see a button instead of a link.
2. To add the icon, same place add the type (add, email, like, next, star etc.) after the 'Button' in the same field and save.
3. Now, I chose to shorten my global.css a bit and add the bus css into it's own file. Remember to update your [theme].info file.
4. If you like to customize a single button (e.g. in a call-to-action box), copy the necessary css into its own section, as not to confuse matters.
Not quite there yet. Still in development. I'd rather wait with posting the link, until completed (or nearly). I promise to do that. Thanks for your interest.
And yes; your css got me going. Thank you for that too. :)
Just use boostrap buttons. They look great, work on all browsers and versions of browsers (as much as is possible) and are done entirely in css. I just checked and downloaded the buttons component and added it to a buttons.css file then added that css to my .info file.
Comments
Comment #1
robloachI think this should be in the module space instead via Button Style or something similar.
Comment #2
Shane Grant commentedI don't think this should be added to the core theme, but if you want it in your sub-theme you can do this in your global.css to add it:
Comment #3
s@ilor commentedThanks for this. Allow me a question;
I want to add call-to-action box in my sidebar. I have created a block. How do I convert a mailto: into a button? In other words; how do I apply the class "Button" to the link?Got that sorted.Now, to get it to show an icon with .email:before, that's another thing ...Update: I figured it out, and here's how for other happy css amateurs like me:
1. Here's how I added a class to a link: in my CKEditor, I marked the text to create a hyperlink. In the advanced settings, write "Button" (without quotes) in the Stylesheet classes field. Save it. You will now see a button instead of a link.
2. To add the icon, same place add the type (add, email, like, next, star etc.) after the 'Button' in the same field and save.
3. Now, I chose to shorten my global.css a bit and add the bus css into it's own file. Remember to update your [theme].info file.
4. If you like to customize a single button (e.g. in a call-to-action box), copy the necessary css into its own section, as not to confuse matters.
- Christian
Comment #4
Shane Grant commentedChristian,
I am sorry I didn't see your question in time to help, but glad you got it sorted!
Did my css help you get these buttons going? Can we see your site to see how it is coming along?
Comment #5
s@ilor commentedNot quite there yet. Still in development. I'd rather wait with posting the link, until completed (or nearly). I promise to do that. Thanks for your interest.
And yes; your css got me going. Thank you for that too. :)
- Christian
Comment #6
FanisTsiros commentedJust to inform that if you use above css code in #2 Fivestar is not working.
Comment #7
loze commentedthe conflict in fivestar is because of this line in the css
.star:before {content: "\2605";}
the class star is used in fivestar's markup. Remove that line or rename the .star class and it works.
Comment #8
herojig commented@ #2, love that button code Shane, thx!
Comment #9
mustardman commentedJust use boostrap buttons. They look great, work on all browsers and versions of browsers (as much as is possible) and are done entirely in css. I just checked and downloaded the buttons component and added it to a buttons.css file then added that css to my .info file.
http://twitter.github.com/bootstrap/customize.html