{"id":10398,"date":"2024-03-03T10:31:00","date_gmt":"2024-03-03T10:31:00","guid":{"rendered":"https:\/\/codehim.com\/?p=10398"},"modified":"2024-03-04T08:31:19","modified_gmt":"2024-03-04T03:31:19","slug":"skeuomorphic-toggle-buttons-using-css","status":"publish","type":"post","link":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/","title":{"rendered":"Skeuomorphic Toggle Buttons Using CSS"},"content":{"rendered":"<p>This code creates toggle buttons styled with CSS. It switches ON\/OFF states for various settings. Using checkboxes, it simulates <a href=\"https:\/\/codehim.com\/vanilla-javascript\/toggle-switch-with-accessibility-in-javascript\/\" target=\"_blank\" rel=\"noopener\">toggle switches<\/a> for different options. This design helps manage and visually toggle settings like comments, newsletters, and tips without using default switches.<\/p>\n<p>You can use this code on websites needing stylish toggle buttons. It offers a sleek way to control settings visually.<\/p>\n<h2>How to Create Skeuomorphic Toggle Buttons Using Css<\/h2>\n<p>1. Start with the HTML structure. Wrap each toggle switch in a <code>&lt;label&gt;<\/code> tag containing a <code>&lt;span&gt;<\/code> for the label text and a structure for the switch itself, using <code>&lt;input&gt;<\/code> and <code>&lt;span&gt;<\/code> elements. Modify the labels within the <code>&lt;span class=\"setting__label\"&gt;<\/code> to suit your settings.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;form&gt;\r\n\t&lt;label class=\"setting\"&gt;\r\n\t\t&lt;span class=\"setting__label\"&gt;Comments&lt;\/span&gt;\r\n\t\t&lt;span class=\"switch\"&gt;\r\n\t\t\t&lt;input class=\"switch__input\" type=\"checkbox\" role=\"switch\" name=\"switch1\"&gt;\r\n\t\t\t&lt;span class=\"switch__fill\" aria-hidden=\"true\"&gt;\r\n\t\t\t\t&lt;span class=\"switch__text\"&gt;ON&lt;\/span&gt;\r\n\t\t\t\t&lt;span class=\"switch__text\"&gt;OFF&lt;\/span&gt;\r\n\t\t\t&lt;\/span&gt;\r\n\t\t&lt;\/span&gt;\r\n\t&lt;\/label&gt;\r\n\t&lt;label class=\"setting\"&gt;\r\n\t\t&lt;span class=\"setting__label\"&gt;Newsletters&lt;\/span&gt;\r\n\t\t&lt;span class=\"switch\"&gt;\r\n\t\t\t&lt;input class=\"switch__input\" type=\"checkbox\" role=\"switch\" name=\"switch2\"&gt;\r\n\t\t\t&lt;span class=\"switch__fill\" aria-hidden=\"true\"&gt;\r\n\t\t\t\t&lt;span class=\"switch__text\"&gt;ON&lt;\/span&gt;\r\n\t\t\t\t&lt;span class=\"switch__text\"&gt;OFF&lt;\/span&gt;\r\n\t\t\t&lt;\/span&gt;\r\n\t\t&lt;\/span&gt;\r\n\t&lt;\/label&gt;\r\n\t&lt;label class=\"setting\"&gt;\r\n\t\t&lt;span class=\"setting__label\"&gt;Tips&lt;\/span&gt;\r\n\t\t&lt;span class=\"switch\"&gt;\r\n\t\t\t&lt;input class=\"switch__input\" type=\"checkbox\" role=\"switch\" name=\"switch3\" checked&gt;\r\n\t\t\t&lt;span class=\"switch__fill\" aria-hidden=\"true\"&gt;\r\n\t\t\t\t&lt;span class=\"switch__text\"&gt;ON&lt;\/span&gt;\r\n\t\t\t\t&lt;span class=\"switch__text\"&gt;OFF&lt;\/span&gt;\r\n\t\t\t&lt;\/span&gt;\r\n\t\t&lt;\/span&gt;\r\n\t&lt;\/label&gt;\r\n&lt;\/form&gt;<\/pre>\n<p>2. Apply CSS styles to customize the appearance of the toggle switches. The following CSS code includes styles for the switches, labels, and their animations.<\/p>\n<pre class=\"prettyprint linenums lang-css\">* {\r\n\tborder: 0;\r\n\tbox-sizing: border-box !important;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n}\r\n:root {\r\n\t--hue: 223;\r\n\t--hue-success: 103;\r\n\t--bg: hsl(var(--hue),10%,80%);\r\n\t--fg: hsl(var(--hue),10%,10%);\r\n\t--primary: hsl(var(--hue),90%,50%);\r\n\t--primary-t: hsla(var(--hue),90%,50%,0);\r\n\t--trans-dur: 0.3s;\r\n\t--trans-timing: cubic-bezier(0.65,0,0.35,1);\r\n\tfont-size: calc(16px + (32 - 16) * (100vw - 320px) \/ (2560 - 320));\r\n}\r\n\r\n\r\nbody, \r\ninput {\r\n\tfont: 1em\/1.5 \"DM Sans\", sans-serif;\r\n}\r\nbody {\r\n\tbackground-color: var(--bg);\r\n\tcolor: var(--fg);\r\n\tdisplay: flex;\r\n\theight: 100vh;\r\n}\r\nform {\r\n\tbackground-color: hsl(var(--hue),10%,90%);\r\n\tborder-radius: 0.25em;\r\n\tbox-shadow: 0 0.25em 0.25em hsla(var(--hue),10%,10%,0.4);\r\n\tmargin: auto;\r\n\twidth: calc(100% - 3em);\r\n\tmax-width: 20em;\r\n}\r\n.setting {\r\n\tbox-shadow:\r\n\t\t0 0.125em 0 hsl(var(--hue),10%,100%) inset,\r\n\t\t0 -0.125em 0 hsl(var(--hue),10%,75%) inset;\r\n\tdisplay: flex;\r\n\tjustify-content: space-between;\r\n\talign-items: center;\r\n\tpadding: 0.75em 1em;\r\n}\r\n.setting:only-child {\r\n\tborder-radius: 0.25em;\r\n}\r\n.setting:first-child {\r\n\tborder-radius: 0.25em 0.25em 0 0;\r\n}\r\n.setting:last-child {\r\n\tborder-radius: 0 0 0.25em 0.25em;\r\n}\r\n.setting__label {\r\n\tmargin-right: 1em;\r\n}\r\n.setting,\r\n.switch__input {\r\n\t-webkit-tap-highlight-color: transparent;\r\n}\r\n.switch,\r\n.switch:before,\r\n.switch:after {\r\n\tdisplay: block;\r\n}\r\n.switch {\r\n\tbackground-image: linear-gradient(hsl(var(--hue),10%,60%),hsl(var(--hue),10%,95%));\r\n\tbox-shadow: 0 0 0.125em 0.125em hsl(var(--hue),10%,90%) inset;\r\n\tborder-radius: 1em;\r\n\tflex-shrink: 0;\r\n\tposition: relative;\r\n\twidth: 5em;\r\n\theight: 2em;\r\n}\r\n.switch:before,\r\n.switch:after {\r\n\tborder-radius: 0.75em;\r\n\tcontent: \"\";\r\n\tposition: absolute;\r\n\ttop: 0.25em;\r\n\tleft: 0.25em;\r\n\twidth: 4.5em;\r\n\theight: 1.5em;\r\n}\r\n.switch:before {\r\n\tbackground-color: hsl(var(--hue),10%,60%);\r\n}\r\n.switch::after {\r\n\tbox-shadow: 0 0 0.5em hsl(var(--hue),10%,20%) inset;\r\n\tz-index: 1;\r\n}\r\n.switch__fill {\r\n\tborder-radius: 0.75em;\r\n\toverflow: hidden;\r\n\tposition: absolute;\r\n\ttop: 0.25em;\r\n\tright: 0;\r\n\tleft: 0.25em;\r\n\twidth: 4.5em;\r\n\theight: 1.5em;\r\n\tz-index: 1;\r\n}\r\n.switch__input {\r\n\tborder-radius: 1em;\r\n\tbox-shadow: 0 0 0 0.125em var(--primary-t);\r\n\tcursor: pointer;\r\n\toutline: transparent;\r\n\tposition: relative;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\ttransition: box-shadow calc(var(--trans-dur) \/ 2) var(--trans-timing);\r\n\tz-index: 2;\r\n\t-webkit-appearance: none;\r\n\tappearance: none;\r\n}\r\n.switch__input:focus-visible {\r\n\tbox-shadow: 0 0 0 0.125em var(--primary);\r\n}\r\n.switch__input:before,\r\n.switch__input:after {\r\n\tborder-radius: 50%;\r\n\tcontent: \"\";\r\n\tdisplay: block;\r\n\tposition: absolute;\r\n\ttransition: transform var(--trans-dur) var(--trans-timing);\r\n}\r\n.switch__input:before {\r\n\tbackground-image: linear-gradient(hsl(0,0%,100%),hsl(var(--hue),10%,60%));\r\n\tbox-shadow:\r\n\t\t0 0 0.125em 0.0625em hsl(var(--hue),10%,40%),\r\n\t\t0 0.25em 0.25em hsla(var(--hue),10%,10%,0.4);\r\n\ttop: 0.125em;\r\n\tleft: 0.125em;\r\n\twidth: 1.75em;\r\n\theight: 1.75em;\r\n}\r\n.switch__input:after {\r\n\tbackground-image: linear-gradient(hsl(var(--hue),10%,90%),hsl(var(--hue),10%,80%));\r\n\ttop: 0.25em;\r\n\tleft: 0.25em;\r\n\twidth: 1.5em;\r\n\theight: 1.5em;\r\n}\r\n.switch__text {\r\n\tbackground-color: hsl(var(--hue-success),90%,50%,0.5);\r\n\tcolor: hsl(var(--hue-success),90%,10%);\r\n\tdisplay: block;\r\n\tfont-size: 0.75em;\r\n\tfont-weight: 700;\r\n\tline-height: 2;\r\n\topacity: 0.6;\r\n\tpadding: 0 0.75em;\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\ttext-shadow: 0 0.0625rem 0 hsl(var(--hue-success),90%,55%);\r\n\ttransform: translateX(-4.25em);\r\n\ttransition: transform var(--trans-dur) var(--trans-timing);\r\n\tz-index: -1;\r\n}\r\n.switch__text + .switch__text {\r\n\tbackground-color: hsla(0,0%,0%,0);\r\n\tcolor: hsl(var(--hue),10%,10%);\r\n\ttext-shadow: 0 0.0625rem 0 hsl(var(--hue),10%,75%);\r\n\ttext-align: right;\r\n\ttransform: translateX(0);\r\n}\r\n.switch__input:checked:before,\r\n.switch__input:checked:after {\r\n\ttransform: translateX(3em);\r\n}\r\n.switch__input:checked + .switch__fill .switch__text {\r\n\ttransform: translateX(0);\r\n}\r\n.switch__input:checked + .switch__fill .switch__text + .switch__text {\r\n\ttransform: translateX(4em);\r\n}\r\n\r\n\/* Dark theme *\/\r\n@media (prefers-color-scheme: dark) {\r\n\t:root {\r\n\t\t--bg: hsl(var(--hue),10%,20%);\r\n\t\t--fg: hsl(var(--hue),10%,90%);\r\n\t\t--primary: hsl(var(--hue),90%,70%);\r\n\t\t--primary-t: hsla(var(--hue),90%,70%,0);\r\n\t}\r\n\tform {\r\n\t\tbackground-color: hsl(var(--hue),10%,30%);\r\n\t}\r\n\t.setting {\r\n\t\tbox-shadow:\r\n\t\t\t0 0.125em 0 hsl(var(--hue),10%,40%) inset,\r\n\t\t\t0 -0.125em 0 hsl(var(--hue),10%,20%) inset;\r\n\t}\r\n\t.switch {\r\n\t\tbackground-image: linear-gradient(hsl(var(--hue),10%,15%),hsl(var(--hue),10%,35%));\r\n\t\tbox-shadow: 0 0 0.125em 0.125em hsl(var(--hue),10%,30%) inset;\r\n\t}\r\n\t.switch:before {\r\n\t\tbackground-color: hsl(var(--hue),10%,40%);\r\n\t}\r\n\t.switch:after {\r\n\t\tbox-shadow: 0 0 0.5em hsl(0,0%,0%) inset;\r\n\t}\r\n\t.switch__input:before {\r\n\t\tbackground-image: linear-gradient(hsl(var(--hue),10%,50%),hsl(var(--hue),10%,20%));\r\n\t\tbox-shadow:\r\n\t\t\t0 0 0.125em 0.0625em hsl(var(--hue),10%,10%),\r\n\t\t\t0 0.25em 0.25em hsla(var(--hue),10%,10%,0.4);\r\n\t}\r\n\t.switch__input:after {\r\n\t\tbackground-image: linear-gradient(hsl(var(--hue),10%,40%),hsl(var(--hue),10%,30%));\r\n\t}\r\n\t.switch__text {\r\n\t\ttext-shadow: 0 0.0625rem 0 hsl(var(--hue-success),90%,45%);\r\n\t}\r\n\t.switch__text + .switch__text {\r\n\t\tcolor: hsl(var(--hue),10%,10%);\r\n\t\ttext-shadow: 0 0.0625rem 0 hsl(var(--hue),10%,55%);\r\n\t}\r\n}<\/pre>\n<p>Adjust the colors, sizes, or animations by modifying the variables in the CSS code, such as hue, background, or text colors. Ensure the toggle buttons are accessible by adding appropriate roles and labels.<\/p>\n<p>Easily integrate these buttons into any web page where stylish toggle switches are needed.<\/p>\n<p>That&#8217;s all! hopefully, you have successfully created Skeuomorphic Toggle Buttons Using CSS. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This code creates toggle buttons styled with CSS. It switches ON\/OFF states for various settings. Using checkboxes, it simulates toggle&#8230;<\/p>\n","protected":false},"author":1,"featured_media":10400,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[63],"tags":[],"class_list":["post-10398","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5-css3"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Skeuomorphic Toggle Buttons Using CSS &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a Skeuomorphic Toggle Buttons Using CSS. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Skeuomorphic Toggle Buttons Using CSS &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a Skeuomorphic Toggle Buttons Using CSS. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-03T10:31:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-04T03:31:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"980\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"Skeuomorphic Toggle Buttons Using CSS\",\"datePublished\":\"2024-03-03T10:31:00+00:00\",\"dateModified\":\"2024-03-04T03:31:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\"},\"wordCount\":208,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png\",\"articleSection\":[\"HTML5 &amp; CSS3\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\",\"url\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\",\"name\":\"Skeuomorphic Toggle Buttons Using CSS &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png\",\"datePublished\":\"2024-03-03T10:31:00+00:00\",\"dateModified\":\"2024-03-04T03:31:19+00:00\",\"description\":\"Here is a free code snippet to create a Skeuomorphic Toggle Buttons Using CSS. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png\",\"width\":1280,\"height\":980,\"caption\":\"Skeuomorphic Toggle Buttons Using CSS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML5 &amp; CSS3\",\"item\":\"https:\/\/codehim.com\/category\/html5-css3\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Skeuomorphic Toggle Buttons Using CSS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Skeuomorphic Toggle Buttons Using CSS &#8212; CodeHim","description":"Here is a free code snippet to create a Skeuomorphic Toggle Buttons Using CSS. You can view demo and download the source code.","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:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/","og_locale":"en_US","og_type":"article","og_title":"Skeuomorphic Toggle Buttons Using CSS &#8212; CodeHim","og_description":"Here is a free code snippet to create a Skeuomorphic Toggle Buttons Using CSS. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-03-03T10:31:00+00:00","article_modified_time":"2024-03-04T03:31:19+00:00","og_image":[{"width":1280,"height":980,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"Skeuomorphic Toggle Buttons Using CSS","datePublished":"2024-03-03T10:31:00+00:00","dateModified":"2024-03-04T03:31:19+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/"},"wordCount":208,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png","articleSection":["HTML5 &amp; CSS3"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/","url":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/","name":"Skeuomorphic Toggle Buttons Using CSS &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png","datePublished":"2024-03-03T10:31:00+00:00","dateModified":"2024-03-04T03:31:19+00:00","description":"Here is a free code snippet to create a Skeuomorphic Toggle Buttons Using CSS. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Skeuomorphic-Toggle-Buttons-Using-CSS.png","width":1280,"height":980,"caption":"Skeuomorphic Toggle Buttons Using CSS"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/html5-css3\/skeuomorphic-toggle-buttons-using-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"HTML5 &amp; CSS3","item":"https:\/\/codehim.com\/category\/html5-css3\/"},{"@type":"ListItem","position":3,"name":"Skeuomorphic Toggle Buttons Using CSS"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":1164,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=10398"}],"version-history":[{"count":1,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10398\/revisions"}],"predecessor-version":[{"id":11322,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10398\/revisions\/11322"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/10400"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=10398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=10398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=10398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}