{"id":18939,"date":"2020-07-02T16:04:19","date_gmt":"2020-07-02T23:04:19","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=18939"},"modified":"2020-12-29T11:48:15","modified_gmt":"2020-12-29T19:48:15","slug":"css-tabs","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/css-tabs\/","title":{"rendered":"Creating Tabs in CSS Without Using JavaScript"},"content":{"rendered":"\n<p>CSS Tabs are really great at displaying associated information in one easy-to-navigate place. They essentially look like tabbed dividers that you would see in a recipe box or a binder. Here are some examples of websites using tabbed navigation:&nbsp;&nbsp;<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.southwest.com\/\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">Southwest Airlines<\/a> uses tabbed navigation to let the user navigate between checking in for a flight, booking a flight or adding a hotel to their reservation.<\/li><li><a href=\"https:\/\/www.enterprise.com\/en\/home.html\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">Enterprise<\/a> uses tabs for navigation to let the user decide between renting or buying, and also learning about their other services.&nbsp;<\/li><\/ul>\n\n\n\n<p>As you observe these two sites, think about what the pros are of using such a UI component on the sites. What problems does it solve? What type of information would tabbed navigation be a good implementation for?&nbsp;<br><\/p>\n\n\n\n<p>When you need to reach for a UI structure that organizes text or information into meaningful components and displays them on the screen without taking up too much space, tabbed navigation is a wise choice. We will talk about tabbed navigation more in-depth as we get into using JavaScript, jQuery and\/or Bootstrap, but there is also an implementation we could use that just requires HTML and pure CSS. Let\u2019s take a look at the setup:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setup your HTML:<\/h3>\n\n\n\n<p>Go ahead and set up your boilerplate HTML with a container inside the body that will serve as our main container for the project. You can call it whatever you\u2019d like in the class attribute, but I will call it <code>class=\u201dtabs\u201d<\/code>. So far, your HTML should look like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n   &lt;meta charset=&quot;UTF-8&quot;&gt;\n   &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n   &lt;title&gt;CSS Tabs&lt;\/title&gt;\n   &lt;style&gt; \/* No CSS to display yet *\/ &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n   &lt;div class=&quot;tabs&quot;&gt;&lt;\/div&gt;\n&lt;body&gt;\n&lt;\/html&gt;\n \n<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Inside the <code>\u201ctabs\u201d &lt;div&gt;<\/code>, we will insert another four more &lt;div&gt;s and call each with a class of <code>tab<\/code>. This represents each of the four tabs that we will be writing up today. It will contain our input, tab labels and tab content. Let\u2019s make empty containers for all of those:&nbsp;<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n   &lt;meta charset=&quot;UTF-8&quot;&gt;\n   &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n   &lt;title&gt;CSS Tabs&lt;\/title&gt;\n   &lt;style&gt; \/* No CSS to display yet *\/ &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n   &lt;div class=&quot;tabs&quot;&gt;\n\t&lt;div class=&quot;tab&quot;&gt;\n\t     \/* THIS IS OUR PLAN IN ACTION*\/\n\t\t\/*input *\/ \n\t\t&lt;input type=&quot;radio&quot; id=&quot;tab-1&quot; name=&quot;tab-group-1&quot; checked\/&gt;\n \t       \/*label for input *\/\n\t\t&lt;label for=&quot;tab-1&quot;&gt;Label 1&lt;\/label&gt;\n             \/* content *\/\n             &lt;div class=&quot;content&quot;&gt;Our content will go here&lt;\/div&gt;\n \n&lt;\/div&gt;\n\t&lt;div class=&quot;tab&quot;&gt;\n\t\t&lt;input type=&quot;radio&quot; id=&quot;tab-2&quot; name=&quot;tab-group-1&quot; checked\/&gt;\n\t\t&lt;label for=&quot;tab-2&quot;&gt;Label 2&lt;\/label&gt;\n             &lt;div class=&quot;content gryffindor&quot;&gt;Our content will go here&lt;\/div&gt;\n       &lt;\/div&gt;\n\t&lt;div class=&quot;tab&quot;&gt;Try these two on your own! Follow the same convention as above for your class names and ids - I am using a HP theme, but name them whatever you'd like!&lt;\/div&gt;\n\t&lt;div class=&quot;tab&quot;&gt;&lt;\/div&gt;\n   &lt;\/div&gt;\n&lt;body&gt;\n&lt;\/html&gt;\n<\/pre><\/div>\n\n\n\n<p>Inside the content class name will be our content. You can use whatever content you\u2019d like, but it\u2019s standard practice to use associated content on one tab.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Time to Start CSS:<\/h2>\n\n\n\n<p>When it comes to writing the CSS, start on the biggest container and work your way to the smallest container. Here is the minimum we need to do to get it to work:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Set a wild card selector to a box-sizing: border-box.<\/li><li>On the main container, we need to have the display property set to flex and have the position set to relative.&nbsp; Display: flex allows the tabs to lay next to each other in a row and the relative position basically acts as a boundary or fence that contains the content of the tab.&nbsp;<\/li><\/ol>\n\n\n\n<p>At this point you will see what looks to be four blocks of text with a radio button and some content. Next we have to figure out a way to show the checked block and hide the other blocks.&nbsp;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>On the .tab container, we\u2019ll set up the styling for the label:<ol><li>1px solid border in any color you wish.<\/li><li>Padding: 5px, 10px \u2013 will add some space around the label text<\/li><li>Border-radius 10px, 10px, 0px, 0px \u2013 this will make the label look more like a traditional tab.&nbsp;<\/li><\/ol><\/li><\/ol>\n\n\n\n<p>If you check your work now, you will see that the labels have the circular radio buttons to the left of them. So it looks more like a traditional tab, but to still keep the checked attribute of the button, we need to hide the circular portion of the radio button.&nbsp;<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>To actually select the button, we use .tab [type=&#8217;radio&#8217;]. To hide it, we set display to none.&nbsp;<\/li><\/ol>\n\n\n\n<p>Next, we need to tackle the actual content so that it only shows one tab at a time.<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Select the content div and then set the position to absolute. When the absolute position is set, the div can be set anywhere inside the relative parent. Using top, right, left and bottom, you can set the content where you want to inside the parent div. In this case,&nbsp; set the left and right properties to 0. We also want to create a border and set a background color to a non-transparent color.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\"><li>Setting the z-index of the selected tab will put that tab\u2019s panel on top. To do so, select the checked button and its content. To do this we use [type=&#8217;radio&#8217;]:checked ~ label ~ .content. The \u201c~ \u201c in between the elements in CSS tells us that we want the content class that occurs after a label element that occurs after a checked radio button.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\"><li>To show which tab is active, set [type=&#8217;radio&#8217;]:checked ~ label to a different background color.&nbsp;<\/li><\/ol>\n\n\n\n<p>Now when the user clicks on each of the tabs, they should be able to successfully go from one to the other without seeing the content of the other panels. This is the minimum you need to get the tabbed navigation to work. Try playing around with the CSS to change up the styling! A working implementation is coded out below:&nbsp;<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n   &lt;meta charset=&quot;UTF-8&quot;&gt;\n   &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n   &lt;title&gt;CSS Tabs&lt;\/title&gt;\n   &lt;style&gt;\n       * {\n           box-sizing: border-box;\n       }\n \n       body {\n           font-family: 'Roboto';\n       }\n \n       .tabs {\n           max-width: 700px;\n           min-height: 100px;\n           margin: 25px 0;\n           width: 100%;\n           display: flex;\n           \/* allows for tabs to be next to each other *\/\n           position: relative;\n           \/* relative here contains the width of the content *\/\n       }\n \n       .tab label {\n           padding: 5px 10px;\n           border: 1px solid #ccc;\n           cursor: pointer;\n           border-radius: 10px 10px 0 0;\n       }\n \n       .tab [type='radio'] {\n           display: none;\n           \/* this makes the radio buttons disappear - we are only keeping track if they are checked or not *\/\n       }\n \n       h3 {\n           margin: 10px 40px;\n       }\n \n       ul {\n           list-style-type: none;\n       }\n       .content {\n           padding: 10px;\n           border-radius: 0px 10px 10px 10px;\n           position: absolute;\n           left: 0;\n           right: 0;\n           background: white;\n           border: 1px solid #ccc;\n           \/* the left and right at 0 help the tabs to overlap each other *\/\n       }\n \n       \/* This allows the selected tab to be on top *\/\n       [type='radio']:checked ~ label ~ .content {\n           z-index: 1;\n       }\n \n       [type=&quot;radio&quot;]:checked ~ label {\n           background: lightgrey;\n       }\n       \/* color scheme for tabs *\/\n       [type='radio']:checked ~ #gryffindor {\n           background: #ec9086;\n           color: #241806;\n       }\n       [type='radio']:checked ~ #ravenclaw {\n           background: #3054ca;\n           color: #241806;\n       }\n \n       [type='radio']:checked ~ #slytherin {\n           background: #089714;\n           color: #252525;\n       }\n       [type='radio']:checked ~ #hufflepuff {\n           background: #f0d695;\n           color: #372e29;\n       }\n \n       [type='radio'] ~ #slytherin {\n           background: #033807;\n           color: #aaaaaa;\n       }\n       [type='radio'] ~ #hufflepuff {\n           background: #f0c75e;\n           color: #372e29;\n       }\n       [type='radio'] ~ #gryffindor {\n           background: #9c1203;\n           color: #e3a000;\n       }\n       [type='radio'] ~ #ravenclaw {\n           background: #0e1a40;\n           color: #946b2d;\n       }\n       .gryffindor {\n           background: #9c1203;\n           color: #e3a000;\n       }\n       .slytherin {\n           background: #033807;\n           color: #aaaaaa;\n       }\n       .hufflepuff {\n           background: #f0c75e;\n           color: #372e29;\n       }\n       .ravenclaw {\n           background: #0e1a40;\n           color: #946b2d;\n       }\n          \n   &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n   &lt;div class=&quot;tabs&quot;&gt;\n       &lt;div class=&quot;tab&quot;&gt;\n           &lt;input type=&quot;radio&quot; id=&quot;tab-1&quot; name=&quot;tab-group-1&quot; checked\/&gt;\n           &lt;label id=&quot;gryffindor&quot; for=&quot;tab-1&quot;&gt;Gryffindor&lt;\/label&gt;\n           &lt;div class=&quot;content gryffindor&quot;&gt;\n               &lt;h3&gt;HP Chars in Gryffindor&lt;\/h3&gt;\n               &lt;ul class=&quot;gryffindor-students&quot;&gt;\n                   &lt;li&gt;Harry Potter&lt;\/li&gt;\n                   &lt;li&gt;Hermione Grainger&lt;\/li&gt;\n                   &lt;li&gt;Ron Weasley&lt;\/li&gt;\n                   &lt;li&gt;Albus Dumbledore&lt;\/li&gt;\n                   &lt;li&gt;Katie Bell&lt;\/li&gt;\n                   &lt;li&gt;Neville Longbottom&lt;\/li&gt;\n               &lt;\/ul&gt;\n           &lt;\/div&gt;\n       &lt;\/div&gt;\n       &lt;div class=&quot;tab&quot;&gt;\n           &lt;input type=&quot;radio&quot; id=&quot;tab-2&quot; name=&quot;tab-group-1&quot;\/&gt;\n           &lt;label id=&quot;slytherin&quot; for=&quot;tab-2&quot;&gt;Slytherin&lt;\/label&gt;\n           &lt;div class=&quot;content slytherin&quot;&gt;\n               &lt;h3&gt;HP Chars in Slytherin&lt;\/h3&gt;\n               &lt;ul class=&quot;slytherin-students&quot;&gt;\n                   &lt;li&gt;Draco Malfoy&lt;\/li&gt;\n                   &lt;li&gt;Narcissa Black&lt;\/li&gt;\n                   &lt;li&gt;Lucius Malfoy&lt;\/li&gt;\n                   &lt;li&gt;Severus Snape&lt;\/li&gt;\n                   &lt;li&gt;Tom Riddle&lt;\/li&gt;\n                   &lt;li&gt;Dolores Umbridge&lt;\/li&gt;\n               &lt;\/ul&gt;\n           &lt;\/div&gt;\n       &lt;\/div&gt;\n       &lt;div class=&quot;tab&quot;&gt;\n           &lt;input type=&quot;radio&quot; id=&quot;tab-3&quot; name=&quot;tab-group-1&quot;\/&gt;\n           &lt;label for=&quot;tab-3&quot; id=&quot;ravenclaw&quot;&gt;Ravenclaw&lt;\/label&gt;\n           &lt;div class=&quot;content ravenclaw&quot;&gt;\n               &lt;h3&gt;HP Chars in Ravenclaw&lt;\/h3&gt;\n               &lt;ul class=&quot;ravenclaw-students&quot;&gt;\n                   &lt;li&gt;Lisa Turpin&lt;\/li&gt;\n                   &lt;li&gt;Luna Lovegood&lt;\/li&gt;\n                   &lt;li&gt;Gilderoy Lockhart&lt;\/li&gt;\n                   &lt;li&gt;Garrick Ollivander&lt;\/li&gt;\n                   &lt;li&gt;Padma Patil&lt;\/li&gt;\n                   &lt;li&gt;Sybil Trelawney&lt;\/li&gt;\n               &lt;\/ul&gt;\n           &lt;\/div&gt;\n       &lt;\/div&gt;\n       &lt;div class=&quot;tab&quot;&gt;\n           &lt;input type=&quot;radio&quot; id=&quot;tab-4&quot; name=&quot;tab-group-1&quot;&gt;\n           &lt;label for=&quot;tab-4&quot; id=&quot;hufflepuff&quot;&gt;Hufflepuff&lt;\/label&gt;\n \n           &lt;div class=&quot;content hufflepuff&quot;&gt;\n               &lt;h3&gt;HP Chars in Hufflepuff&lt;\/h3&gt;\n               &lt;ul class=&quot;hufflepuff-students&quot;&gt;\n                   &lt;li&gt;Cedric Diggory&lt;\/li&gt;\n                   &lt;li&gt;Newton Scamander&lt;\/li&gt;\n                   &lt;li&gt;Nymphadora Tonks&lt;\/li&gt;\n                   &lt;li&gt;Pomona Sprout&lt;\/li&gt;\n                   &lt;li&gt;Susan Bones&lt;\/li&gt;\n                   &lt;li&gt;Teddy Lupin&lt;\/li&gt;\n               &lt;\/ul&gt;\n           &lt;\/div&gt;\n       &lt;\/div&gt;\n   &lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"CSS Tabs are really great at displaying associated information in one easy-to-navigate place. They essentially look like tabbed dividers that you would see in a recipe box or a binder. Here are some examples of websites using tabbed navigation:&nbsp;&nbsp; Southwest Airlines uses tabbed navigation to let the user navigate between checking in for a flight,&hellip;","protected":false},"author":77,"featured_media":10909,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17287],"tags":[],"class_list":{"0":"post-18939","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-css"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"CSS","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Creating Tabs in CSS Without Using JavaScript | Career Karma<\/title>\n<meta name=\"description\" content=\"Designers and developers utilize tabs in their applications to help guide the user experience of an application. Learn how to create tabs using pure CSS with this tutorial!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/css-tabs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Tabs in CSS Without Using JavaScript\" \/>\n<meta property=\"og:description\" content=\"Designers and developers utilize tabs in their applications to help guide the user experience of an application. Learn how to create tabs using pure CSS with this tutorial!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/css-tabs\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-02T23:04:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-29T19:48:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/kobu-agency-ipARHaxETRk-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Christina Kopecky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christina Kopecky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/\"},\"author\":{\"name\":\"Christina Kopecky\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\"},\"headline\":\"Creating Tabs in CSS Without Using JavaScript\",\"datePublished\":\"2020-07-02T23:04:19+00:00\",\"dateModified\":\"2020-12-29T19:48:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/\"},\"wordCount\":842,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/kobu-agency-ipARHaxETRk-unsplash.jpg\",\"articleSection\":[\"CSS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/\",\"name\":\"Creating Tabs in CSS Without Using JavaScript | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/kobu-agency-ipARHaxETRk-unsplash.jpg\",\"datePublished\":\"2020-07-02T23:04:19+00:00\",\"dateModified\":\"2020-12-29T19:48:15+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\"},\"description\":\"Designers and developers utilize tabs in their applications to help guide the user experience of an application. Learn how to create tabs using pure CSS with this tutorial!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/kobu-agency-ipARHaxETRk-unsplash.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/kobu-agency-ipARHaxETRk-unsplash.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css-tabs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/css\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating Tabs in CSS Without Using JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\",\"name\":\"Christina Kopecky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"caption\":\"Christina Kopecky\"},\"description\":\"Christina is an experienced technical writer, covering topics as diverse as Java, SQL, Python, and web development. She earned her Master of Music in flute performance from the University of Kansas and a bachelor's degree in music with minors in French and mass communication from Southeast Missouri State. Prior to joining the Career Karma team in June 2020, Christina was a teaching assistant, team lead, and section lead at Lambda School, where she led student groups, performed code and project reviews, and debugged problems for students. Christina's technical content is featured frequently in publications like Codecademy, Repl.it, and Educative.\",\"sameAs\":[\"http:\\\/\\\/www.linkedin.com\\\/in\\\/cmvnk\"],\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/christina-kopecky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Creating Tabs in CSS Without Using JavaScript | Career Karma","description":"Designers and developers utilize tabs in their applications to help guide the user experience of an application. Learn how to create tabs using pure CSS with this tutorial!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/css-tabs\/","og_locale":"en_US","og_type":"article","og_title":"Creating Tabs in CSS Without Using JavaScript","og_description":"Designers and developers utilize tabs in their applications to help guide the user experience of an application. Learn how to create tabs using pure CSS with this tutorial!","og_url":"https:\/\/careerkarma.com\/blog\/css-tabs\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-07-02T23:04:19+00:00","article_modified_time":"2020-12-29T19:48:15+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/kobu-agency-ipARHaxETRk-unsplash.jpg","type":"image\/jpeg"}],"author":"Christina Kopecky","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"Christina Kopecky","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/"},"author":{"name":"Christina Kopecky","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e"},"headline":"Creating Tabs in CSS Without Using JavaScript","datePublished":"2020-07-02T23:04:19+00:00","dateModified":"2020-12-29T19:48:15+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/"},"wordCount":842,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/kobu-agency-ipARHaxETRk-unsplash.jpg","articleSection":["CSS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/css-tabs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/","url":"https:\/\/careerkarma.com\/blog\/css-tabs\/","name":"Creating Tabs in CSS Without Using JavaScript | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/kobu-agency-ipARHaxETRk-unsplash.jpg","datePublished":"2020-07-02T23:04:19+00:00","dateModified":"2020-12-29T19:48:15+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e"},"description":"Designers and developers utilize tabs in their applications to help guide the user experience of an application. Learn how to create tabs using pure CSS with this tutorial!","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/css-tabs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/kobu-agency-ipARHaxETRk-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/kobu-agency-ipARHaxETRk-unsplash.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/css-tabs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/careerkarma.com\/blog\/css\/"},{"@type":"ListItem","position":3,"name":"Creating Tabs in CSS Without Using JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e","name":"Christina Kopecky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","caption":"Christina Kopecky"},"description":"Christina is an experienced technical writer, covering topics as diverse as Java, SQL, Python, and web development. She earned her Master of Music in flute performance from the University of Kansas and a bachelor's degree in music with minors in French and mass communication from Southeast Missouri State. Prior to joining the Career Karma team in June 2020, Christina was a teaching assistant, team lead, and section lead at Lambda School, where she led student groups, performed code and project reviews, and debugged problems for students. Christina's technical content is featured frequently in publications like Codecademy, Repl.it, and Educative.","sameAs":["http:\/\/www.linkedin.com\/in\/cmvnk"],"url":"https:\/\/careerkarma.com\/blog\/author\/christina-kopecky\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=18939"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18939\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/10909"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=18939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=18939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=18939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}