{"id":8187,"date":"2019-11-12T16:04:21","date_gmt":"2019-11-12T21:04:21","guid":{"rendered":"https:\/\/www.med.unc.edu\/webguide\/?page_id=8187"},"modified":"2025-11-18T09:38:22","modified_gmt":"2025-11-18T14:38:22","slug":"buttons","status":"publish","type":"page","link":"https:\/\/www.med.unc.edu\/webguide\/userguide\/styling-content\/buttons\/","title":{"rendered":"Buttons"},"content":{"rendered":"<h2>Large Buttons<\/h2>\n<a class=\"btn btn-default btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<a class=\"btn btn-primary btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<h2>Small Buttons<\/h2>\n<a class=\"btn btn-default btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<a class=\"btn btn-primary btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-sm  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<h2>Extra Small Buttons<\/h2>\n<a class=\"btn btn-default btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<a class=\"btn btn-primary btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-xs  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<h2>Buttons With Icons<\/h2>\n<p>There are a number of icons that can be added to a button.<\/p>\n<a class=\"btn btn-primary btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\"><i class=\"glyphicon glyphicon-heart\" style=\"color:#ffffff;\"><\/i> Donate<\/a>\n<a class=\"btn btn-success btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\"><i class=\"fa fa-automobile\" style=\"color:#ffffff;\"><\/i> Our Location<\/a>\n<a class=\"btn btn-link btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\"><i class=\"fa fa-calendar\" style=\"color:#ffffff;\"><\/i> Appointments<\/a>\n<h2>Full Width Buttons<\/h2>\n<p>Create block level buttons\u2014those that span the full width of it&#8217;s containing element\u2014by selecting the <strong>make block<\/strong> option.<\/p>\n<a class=\"btn btn-default btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Default<\/a>\n<a class=\"btn btn-primary btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-block  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<hr  style=\"margin:30px 0\"class=\" rule-thin osc-rule\" \/>\n<h2>How to Add a Button<\/h2>\n<ol>\n<li>Place your cursor in the location where you wish to add the button.<\/li>\n<li>Select <strong>Button<\/strong> from the <strong>Content Elements dropdown menu<\/strong>, under <strong>Basic Elements<\/strong>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageBorder list-image alignnone wp-image-8199\" src=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2022\/05\/960A7507-48BE-48D9-AB1C-A444FB3277C5.jpeg\" alt=\"\" width=\"360\" height=\"249\" \/><\/li>\n<li><strong>Tip<\/strong>: If you don\u2019t see the\u00a0<strong>Content Elements<\/strong>\u00a0button in the editor, click the\u00a0<strong>Toolbar Toggle<\/strong> button. This toggles the visibility of\u00a0a collection of buttons in the editor.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageBorder list-image alignnone wp-image-12038 size-full\" src=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2022\/05\/5EA5FD95-E9CB-4651-8A6E-951CB1986808_4_5005_c.jpeg\" alt=\"Toolbar Toggle View\" width=\"775\" height=\"150\" \/><\/li>\n<li>A dialog box will appear that allows you to style your button.\n<ul>\n<li><strong>Style<\/strong> &#8211; this correlates to the color of the button.\u00a0 There are 7 color options:\n<ol>\n<li><strong>Simple<\/strong> = <strong>White<\/strong> button<\/li>\n<li><strong>Primary<\/strong> = <strong>Blue<\/strong> button<\/li>\n<li><strong>Success<\/strong>\u00a0 =<strong>\u00a0Green<\/strong> button<\/li>\n<li><strong>Information<\/strong> = <strong>Pea Green<\/strong> button<\/li>\n<li><strong>Warning<\/strong> = <strong>Orange<\/strong> button<\/li>\n<li><strong>Danger<\/strong> = <strong>Red<\/strong> button<\/li>\n<li><strong>Link<\/strong> = <strong>Gray<\/strong> button<\/li>\n<\/ol>\n<\/li>\n<li><strong>Size<\/strong> &#8211; select the size of the button.<\/li>\n<li><strong>Type<\/strong> &#8211; leave this set to Link, allowing you to add a URL for the button to link to.<\/li>\n<li><strong>Select Icon<\/strong> &#8211; an optional icon can be added to the button.<\/li>\n<li><strong>Icon Alignment<\/strong> &#8211; align the icon to the left or right of the button text.<\/li>\n<li><strong>Icon Color<\/strong> &#8211; select an icon color that ensures <a href=\"https:\/\/www.med.unc.edu\/webguide\/accessibility\/color\/\">sufficient contrast for accessibility<\/a>. Here are some suggested colors that provide adequate contrast:\n<ul>\n<li>Default buttons &#8211; white (#ffffff)<\/li>\n<li>Dark buttons &#8211; white (#ffffff)<\/li>\n<li>Light buttons &#8211;<\/li>\n<\/ul>\n<\/li>\n<li><strong>Make Block<\/strong>\n<ul>\n<li>Expands the button to fill the full width of its container (such as a column or content area).<\/li>\n<li>Ensures the button sits on its own line, meaning no other elements will appear next to it\u2014even if they seem aligned in the editor.<\/li>\n<li>Useful for creating uniform button sizes.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Title<\/strong> &#8211; enter the text you want displayed on the button.<\/li>\n<li><strong>Link<\/strong> &#8211; replace the pound sign (#) with the url the button should link to.<\/li>\n<li><strong>Custom Class<\/strong> &#8211; dark and light versions of our buttons can be applied with custom classes. See examples below.\n<ul>\n<li>Add <strong>btn-light<\/strong> to the Custom Class field to get the light version of any button.<\/li>\n<li>Add <strong>btn-dark<\/strong> to the Custom Class field to get the dark version of any button.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13534\" src=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/06\/Screenshot-2024-06-10-at-4.24.26\u202fPM.png\" alt=\"Screenshot showing the btn-dark class being used in the Custom Class field.\" width=\"382\" height=\"45\" srcset=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/06\/Screenshot-2024-06-10-at-4.24.26\u202fPM.png 382w, https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/06\/Screenshot-2024-06-10-at-4.24.26\u202fPM-300x35.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Click the <strong>Insert Button<\/strong> button and the button shortcode will be added to the page.<\/li>\n<\/ol>\n<hr class=\"30 rule-thin osc-rule\" \/>\n<h2>Alternate Color Options<\/h2>\n<p>Light and dark versions of our buttons are available. To use these options, insert <strong>btn-light<\/strong> or <strong>btn-dark<\/strong> in the <strong>Custom Class<\/strong> field when generating the shortcode for a button.<\/p>\n<h3>Light Buttons<\/h3>\n<p>These buttons should be displayed on a dark background to ensure adequate contrast between the buttons and the background color.<\/p>\n<div class = \"alert alert-info notification-dark-blue oscitas-bootstrap-container\">\n<a class=\"btn btn-default btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<a class=\"btn btn-primary btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<\/div>\n<hr class=\"30 rule-thin osc-rule\" \/>\n<h3>Dark Buttons<\/h3>\n<p>These buttons should be displayed on a light background to ensure adequate contrast between the buttons and the background color.<\/p>\n<div class = \"alert alert-info  oscitas-bootstrap-container\">\n<a class=\"btn btn-primary btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<\/div>\n<hr class=\"30 rule-thin osc-rule\" \/>\n<h2>Adequate Contrast<\/h2>\n<p>This demonstrates which buttons have <a href=\"https:\/\/www.med.unc.edu\/webguide\/accessibility\/color\/\">adequate contrast<\/a> when placed on these sample background colors.<\/p>\n<h3>White Background (#ffffff)<\/h3>\n<h4 style=\"text-align: center;\">Medium Buttons<\/h4>\n<a class=\"btn btn-primary btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center;\">Dark Buttons<\/h4>\n<a class=\"btn btn-primary btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<p>&nbsp;<\/p>\n<h3>SOM Light Blue Background (#e2eff8)<\/h3>\n<div class = \"alert alert-info  oscitas-bootstrap-container\">\n<h4 style=\"text-align: center;\">Medium Buttons<\/h4>\n<a class=\"btn btn-primary btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center;\">Dark Buttons<\/h4>\n<a class=\"btn btn-primary btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<\/div>\n<h3>SOM Medium Blue Background (#257cb7)<\/h3>\n<div class = \"alert alert-info notification-med-blue oscitas-bootstrap-container\">\n<h4 style=\"text-align: center; color: #fff;\">Light Buttons<\/h4>\n<a class=\"btn btn-default btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<a class=\"btn btn-primary btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center; color: #fff;\">Medium Buttons<\/h4>\n<a class=\"btn btn-default btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center; color: #fff;\">Dark Buttons<\/h4>\n<a class=\"btn btn-default btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<\/div>\n<h3>SOM Dark Blue Background (#08446d)<\/h3>\n<div class = \"alert alert-info notification-dark-blue oscitas-bootstrap-container\">\n<h4 style=\"text-align: center; color: #fff;\">Light Buttons<\/h4>\n<a class=\"btn btn-default btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<a class=\"btn btn-primary btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Primary<\/a>\n<a class=\"btn btn-success btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Success<\/a>\n<a class=\"btn btn-info btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Information<\/a>\n<a class=\"btn btn-warning btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Warning<\/a>\n<a class=\"btn btn-danger btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Danger<\/a>\n<a class=\"btn btn-link btn-lg btn-light  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Link<\/a>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center; color: #fff;\">Medium Buttons<\/h4>\n<a class=\"btn btn-default btn-lg  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center; color: #fff;\">Dark Buttons<\/h4>\n<a class=\"btn btn-default btn-lg btn-dark  oscitas-bootstrap-container\" target=\"_self\" href=\"#\">Simple<\/a>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Large Buttons Small Buttons Extra Small Buttons Buttons With Icons There are a number of icons that can be added to a button. Full Width Buttons Create block level buttons\u2014those that span the full width of it&#8217;s containing element\u2014by selecting the make block option. How to Add a Button Place your cursor in the location &hellip; <a href=\"https:\/\/www.med.unc.edu\/webguide\/userguide\/styling-content\/buttons\/\" aria-label=\"Read more about Buttons\">Read more<\/a><\/p>\n","protected":false},"author":3206,"featured_media":0,"parent":2212,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"layout":"","cellInformation":"","apiCallInformation":"","footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-8187","page","type-page","status-publish","hentry","odd"],"acf":[],"_links_to":[],"_links_to_target":[],"_links":{"self":[{"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/pages\/8187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/users\/3206"}],"replies":[{"embeddable":true,"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/comments?post=8187"}],"version-history":[{"count":0,"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/pages\/8187\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/pages\/2212"}],"wp:attachment":[{"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/media?parent=8187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}