{"id":9683,"date":"2020-11-24T13:06:48","date_gmt":"2020-11-24T18:06:48","guid":{"rendered":"https:\/\/www.med.unc.edu\/webguide\/?page_id=9683"},"modified":"2025-11-18T09:39:21","modified_gmt":"2025-11-18T14:39:21","slug":"tabs","status":"publish","type":"page","link":"https:\/\/www.med.unc.edu\/webguide\/userguide\/styling-content\/tabs\/","title":{"rendered":"Tabs"},"content":{"rendered":"<p>Tabs can be added to a page to selectively show and hide content. Here is a simple example of what tabs look like:<\/p>\n\n<ul class=\"nav nav-tabs oscitas-bootstrap-container yourcustomclass\" id=\"unc-tab-0\" role=\"tablist\">\n\n    \n        \n            <li class=\"active oscitas-bootstrap-container nav-tab-list-item\" role=\"tab\" aria-selected=\"true\">\n\n                    \n            <a role=\"button\" class=\" oscitas-bootstrap-container nav-tab-button\" href=\"#tabs-0-0\" data-toggle=\"tab\">\n\n            Tab number 1\n            <\/a>\n\n        <\/li>\n\n    \n        \n            <li role=\"tab\" class=\"nav-tab-list-item\" aria-selected=\"false\">\n\n                    \n            <a role=\"button\" class=\" oscitas-bootstrap-container nav-tab-button\" href=\"#tabs-0-1\" data-toggle=\"tab\">\n\n            Tab number 2\n            <\/a>\n\n        <\/li>\n\n    \n        \n            <li role=\"tab\" class=\"nav-tab-list-item\" aria-selected=\"false\">\n\n                    \n            <a role=\"button\" class=\" oscitas-bootstrap-container nav-tab-button\" href=\"#tabs-0-2\" data-toggle=\"tab\">\n\n            Tab number 3\n            <\/a>\n\n        <\/li>\n\n    \n        \n            <li role=\"tab\" class=\"nav-tab-list-item\" aria-selected=\"false\">\n\n                    \n            <a role=\"button\" class=\" oscitas-bootstrap-container nav-tab-button\" href=\"#tabs-0-3\" data-toggle=\"tab\">\n\n            Tab number 4\n            <\/a>\n\n        <\/li>\n\n    \n<\/ul>\n\n<div class=\"tab-content\">\n\n    \n        <div role=\"tabpanel\" class=\"tab-pane active oscitas-bootstrap-container\" id=\"tabs-0-0\">\n        \n            Tab 1 Content Goes Here.\n        <\/div>\n\n    \n        <div role=\"tabpanel\" class=\"tab-pane  oscitas-bootstrap-container\" id=\"tabs-0-1\">\n        \n            Hello everyone!\n        <\/div>\n\n    \n        <div role=\"tabpanel\" class=\"tab-pane  oscitas-bootstrap-container\" id=\"tabs-0-2\">\n        \n            How are you?\n        <\/div>\n\n    \n        <div role=\"tabpanel\" class=\"tab-pane  oscitas-bootstrap-container\" id=\"tabs-0-3\">\n        \n            More information goes here.\n        <\/div>\n\n    \n<\/div>\n<h2>Issues With Tabs<\/h2>\n<p>There are some concerns when using tabs:<\/p>\n<ol>\n<li>Some site visitors might overlook the fact that there are tabs on the page and won&#8217;t see the content they contain.<\/li>\n<li>Most site visitors don&#8217;t like to hunt for the content they are looking for. They also want to find the information with the fewest amount of clicks. With tabs however, you are hiding content and causing site visitors to click through all the tabs to find information.<\/li>\n<li>If someone was to print a web page with tabs on it, only the content of the active\/visible tab would print. If you had important information in tabs that someone needed to print, they would need to print the page for each tab.<\/li>\n<li>Likewise, if someone was to search your web page, it would only search the active\/visible tab.<\/li>\n<\/ol>\n<div class = \"alert alert-success tip oscitas-bootstrap-container\">\n<i class=\" fas fa-lightbulb fa-1x \" style=\"color:#007fae;\"><\/i> TIP<\/p>\n<p>Did you know that holding down the <strong>Control<\/strong> key on your keyboard and hitting the <strong>F<\/strong> key (<strong>CTRL + F<\/strong> on Windows and <strong>Command + F<\/strong> on Mac) allows you to find (search for) a word or phrase on a web page? This keyboard shortcut can be very useful and works in many programs such as web browsers, Word document, and PDFs.<\/p>\n<\/div>\n<h2>How to Add Tabs<\/h2>\n<ol>\n<li>Place your cursor where you want the tabs to display on the page.<\/li>\n<li>Select <strong>Tabs<\/strong> from the <strong>Content Elements<\/strong><strong>\u00a0dropdown menu<\/strong> under <strong>Interactive<\/strong>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"imageBorder list-image alignnone wp-image-13817 \" src=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/10\/Tabs-Button-in-Editor-300x179.png\" alt=\"Where to find Tabs button in the editor\" width=\"404\" height=\"241\" srcset=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/10\/Tabs-Button-in-Editor-300x179.png 300w, https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/10\/Tabs-Button-in-Editor-560x335.png 560w, https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2024\/10\/Tabs-Button-in-Editor.png 574w\" sizes=\"auto, (max-width: 404px) 100vw, 404px\" \/><\/li>\n<li>If you don&#8217;t see the Content Elements plugin button, (as shown in the example above), click the <strong>Toolbar Toggle<\/strong> button. The Toolbar Toggle button shows and hides a collection of buttons in the editor.<img loading=\"lazy\" decoding=\"async\" class=\"imageBorder list-image alignnone wp-image-7794\" src=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2019\/09\/Screen-Shot-2019-09-30-at-2.59.26-PM.png\" alt=\"Toolbar Toggle button\" width=\"300\" height=\"285\" srcset=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2019\/09\/Screen-Shot-2019-09-30-at-2.59.26-PM.png 394w, https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2019\/09\/Screen-Shot-2019-09-30-at-2.59.26-PM-300x285.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/li>\n<li>Shortcode will be added to the page that will create 4 tabs. The shortcode will look like this:<code>[tabs class=\"yourcustomclass\"]\n[tab title=\"Tab number 1\" active=\"active\"]Tab 1 Content Goes Here.[\/tab]\n[tab title=\"Tab number 2\"]Tab 2 Content Goes Here.[\/tab]\n[tab title=\"Tab number 3\"]Tab 3 Content Goes Here.[\/tab]\n[tab title=\"Tab number 4\"]Tab 4 Content Goes Here.[\/tab]\n[\/tabs]<\/code><\/li>\n<li>Add a title to each tab by replacing <strong>Tab number #<\/strong> in the shortcode. Don&#8217;t remove the quotes. Simply edit the content within the quotes.<code>[tab title=\"<strong>Tab number 2<\/strong>\"]Tab 2 Content Goes Here.[\/tab]<\/code><\/li>\n<li>Add content to each tab by replacing <strong>Tab # Content Goes Here<\/strong>.<code>[tab title=\"Tab number 2\"]<strong>Tab 2 Content Goes Here.<\/strong>[\/tab]<\/code><\/li>\n<li>The shortcode automatically creates 4 tabs, but you can add or remove tabs as needed. Simply add or delete whole tab sections.<code>[tab title=\"Tab number 4\"]Tab 4 Content Goes Here.[\/tab]<\/code><\/li>\n<\/ol>\n<h2>Examples<\/h2>\n<h3>Department of Psychiatry<\/h3>\n<p><span class=\"imgBorderMed\"><a href=\"https:\/\/www.med.unc.edu\/psych\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.med.unc.edu\/webguide\/wp-content\/uploads\/sites\/419\/2020\/11\/psych-tabs-example.png\" alt=\"Example of tabs being used on the Department of Psychiatry website.\" width=\"800\" height=\"520\" \/><\/a><\/span><\/p>\n<p><a href=\"https:\/\/www.med.unc.edu\/psych\/\">The Department of Psychiatry homepage<\/a> uses tabs to display their social media.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tabs can be added to a page to selectively show and hide content. Here is a simple example of what tabs look like: Issues With Tabs There are some concerns when using tabs: Some site visitors might overlook the fact that there are tabs on the page and won&#8217;t see the content they contain. Most &hellip; <a href=\"https:\/\/www.med.unc.edu\/webguide\/userguide\/styling-content\/tabs\/\" aria-label=\"Read more about Tabs\">Read more<\/a><\/p>\n","protected":false},"author":89184,"featured_media":0,"parent":2212,"menu_order":17,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"layout":"","cellInformation":"","apiCallInformation":"","footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-9683","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\/9683","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\/89184"}],"replies":[{"embeddable":true,"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/comments?post=9683"}],"version-history":[{"count":0,"href":"https:\/\/www.med.unc.edu\/webguide\/wp-json\/wp\/v2\/pages\/9683\/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=9683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}