Thanks to jQuery UI, I can easily:
- having buttons with text only
- having buttons with text + icons
- having buttons with icon only
The problem is the font was too big so I added this css:
.ui-button .ui-button-text {
font-size:60%;
}
But now the problem is I didn’t have any space between my icon and my text.
See here for demo (jsFiddle): http://jsfiddle.net/Rn9tg/71/
Is there any fix?
Thanks.
[UPDATE]: Using left-margin rule does not work with icon only buttons. I replaced
left-marginrule by atext-indentrule which seems to resolve the problem.Add the following CSS rule
This instruct that any
ui-button-textclass, which are the second child of a parent should have a left margin of 5px. In this case, the label always is the second child when it is preceded by the icon.Learn more about nth-child pseudo selector at css-tricks.
[UPDATE]
Internet Explorer -specially older versions- does not support nth-chil pseudo selector correctly. In this case, you should use jquery to force IE to use an additional class.
Add the following class in a IE exclusive CSS file:
With jQuery, force IE to use the above class for labels which fallows an icon: