Foundation Button
Button Styles
Foundation provides 6 button styles..buttonThe class creates a blue button with padding. The classes for buttons of different colors are:.secondary, .success, .info, .warningor.alert:
Example
<button type="button" class="button">Default</button>
<button type="button" class="button secondary">Secondary</button>
<button type="button" class="button success">Success</button>
<button type="button" class="button info">Info</button>
<button type="button" class="button warning">Warning</button>
<button type="button" class="button alert">Alert</button>
<button type="button" class="button secondary">Secondary</button>
<button type="button" class="button success">Success</button>
<button type="button" class="button info">Info</button>
<button type="button" class="button warning">Warning</button>
<button type="button" class="button alert">Alert</button>
Try it Yourself »
Button classes can be used on<a>, <button>, or<input>Element:
Example
<a href="#" class="button info" role="button">Link Button</a>
<button type="button" class="button info">Button</button>
<input type="button" class="button info" value="Input Button">
<input type="submit" class="button info" value="Submit Button">
<button type="button" class="button info">Button</button>
<input type="button" class="button info" value="Input Button">
<input type="submit" class="button info" value="Submit Button">
Try it Yourself »
![]() |
Why set the href of the a tag to #? When we don't want the link to jump to a "404" page when clicked, we can set the href of the a tag to #. |
|---|
Button Size
We can use.large, .smallor.tinyclasses to set the button size:
Example
<button type="button" class="button large">Large</button>
<button type="button" class="button">Default</button>
<button type="button" class="button small">Small</button>
<button type="button" class="button tiny">Tiny</button>
<button type="button" class="button">Default</button>
<button type="button" class="button small">Small</button>
<button type="button" class="button tiny">Tiny</button>
Try it Yourself »
Rounded Button
You can use.radiusand.roundclasses to set rounded buttons:
Example
<button type="button" class="button">Default Button</button>
<button type="button" class="button radius">Radius Button</button>
<button type="button" class="button round">Round Button</button>
<button type="button" class="button radius">Radius Button</button>
<button type="button" class="button round">Round Button</button>
Try it Yourself »
Expanded Button
You can use.expandThe class used to set the button's width to 100%:
Example
<button type="button" class="button">Default Button</button>
<button type="button" class="button expand">Expanded Button</button>
<button type="button" class="button expand">Expanded Button</button>
Try it Yourself »
Disabled Button
You can use.disabledclasses to make the button non-clickable:
Example
<button type="button" class="button">Default Button</button>
<button type="button" class="button disabled">Disabled Button</button>
<button type="button" class="button disabled">Disabled Button</button>
Try it Yourself »
