{"id":1624,"date":"2023-07-07T14:04:56","date_gmt":"2023-07-07T11:04:56","guid":{"rendered":"https:\/\/notes.profidev.online\/?p=1624"},"modified":"2023-07-07T14:04:58","modified_gmt":"2023-07-07T11:04:58","slug":"checkbox","status":"publish","type":"post","link":"https:\/\/notes.profidev.online\/ru\/switch\/1624\/","title":{"rendered":"Checkbox"},"content":{"rendered":"\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"808\" height=\"355\" src=\"https:\/\/notes.profidev.online\/wp-content\/uploads\/2023\/07\/peek-2023-07-07-13-02.gif\" alt=\"Checkbox\" class=\"wp-image-1626 size-full\"\/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">  &lt;div class=&quot;ondisplay&quot;&gt;\n    \n    &lt;section title=&quot;.slideOne&quot;&gt;\n      &lt;!-- .slideOne --&gt;\n      &lt;div class=&quot;slideOne&quot;&gt;  \n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;slideOne&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;slideOne&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .slideOne --&gt;\n    &lt;\/section&gt;\n  \n    &lt;section title=&quot;.slideTwo&quot;&gt;\n      &lt;!-- .slideTwo --&gt;\n      &lt;div class=&quot;slideTwo&quot;&gt;  \n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;slideTwo&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;slideTwo&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .slideTwo --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.slideThree&quot;&gt;\n      &lt;!-- .slideThree --&gt;\n      &lt;div class=&quot;slideThree&quot;&gt;  \n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;slideThree&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;slideThree&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .slideThree --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.roundedOne&quot;&gt;\n      &lt;!-- .roundedOne --&gt;\n      &lt;div class=&quot;roundedOne&quot;&gt;\n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;roundedOne&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;roundedOne&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .roundedOne --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.roundedTwo&quot;&gt;\n      &lt;!-- .roundedTwo --&gt;\n      &lt;div class=&quot;roundedTwo&quot;&gt;\n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;roundedTwo&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;roundedTwo&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .roundedTwo --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.squaredOne&quot;&gt;\n      &lt;!-- .squaredOne --&gt;\n      &lt;div class=&quot;squaredOne&quot;&gt;\n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;squaredOne&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;squaredOne&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .squaredOne --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.squaredTwo&quot;&gt;\n      &lt;!-- .squaredTwo --&gt;\n      &lt;div class=&quot;squaredTwo&quot;&gt;\n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;squaredTwo&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;squaredTwo&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .squaredTwo --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.squaredThree&quot;&gt;\n      &lt;!-- .squaredThree --&gt;\n      &lt;div class=&quot;squaredThree&quot;&gt;\n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;squaredThree&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;squaredThree&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .squaredThree --&gt;\n    &lt;\/section&gt;\n    \n    &lt;section title=&quot;.squaredFour&quot;&gt;\n      &lt;!-- .squaredFour --&gt;\n      &lt;div class=&quot;squaredFour&quot;&gt;\n        &lt;input type=&quot;checkbox&quot; value=&quot;None&quot; id=&quot;squaredFour&quot; name=&quot;check&quot; checked \/&gt;\n        &lt;label for=&quot;squaredFour&quot;&gt;&lt;\/label&gt;\n      &lt;\/div&gt;\n      &lt;!-- end .squaredFour --&gt;\n    &lt;\/section&gt;\n  &lt;\/div&gt;<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;css&quot;,&quot;mime&quot;:&quot;text\/css&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;CSS&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;css&quot;}\">.slideOne {\n  width: 50px;\n  height: 10px;\n  background: #333;\n  margin: 20px auto;\n  position: relative;\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 0.2);\n}\n.slideOne label {\n  display: block;\n  width: 16px;\n  height: 16px;\n  position: absolute;\n  top: -3px;\n  left: -3px;\n  cursor: pointer;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  border-radius: 50px;\n  box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3);\n  transition: all 0.4s ease;\n}\n.slideOne input[type=checkbox] {\n  visibility: hidden;\n}\n.slideOne input[type=checkbox]:checked + label {\n  left: 37px;\n}\n\n.slideTwo {\n  width: 80px;\n  height: 30px;\n  background: #333;\n  margin: 20px auto;\n  position: relative;\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 0.2);\n}\n.slideTwo:after {\n  content: '';\n  position: absolute;\n  top: 14px;\n  left: 14px;\n  height: 2px;\n  width: 52px;\n  background: #111;\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 0.2);\n}\n.slideTwo label {\n  display: block;\n  width: 22px;\n  height: 22px;\n  cursor: pointer;\n  position: absolute;\n  top: 4px;\n  z-index: 1;\n  left: 4px;\n  background: #fcfff4;\n  border-radius: 50px;\n  transition: all 0.4s ease;\n  box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3);\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n}\n.slideTwo label:after {\n  content: '';\n  width: 10px;\n  height: 10px;\n  position: absolute;\n  top: 6px;\n  left: 6px;\n  background: #333;\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px black, 0px 1px 0px rgba(255, 255, 255, 0.9);\n}\n.slideTwo input[type=checkbox] {\n  visibility: hidden;\n}\n.slideTwo input[type=checkbox]:checked + label {\n  left: 54px;\n}\n.slideTwo input[type=checkbox]:checked + label:after {\n  background: #27ae60;\n  \/*activeColor*\/\n}\n\n.slideThree {\n  width: 80px;\n  height: 26px;\n  background: #333;\n  margin: 20px auto;\n  position: relative;\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 0.2);\n}\n.slideThree:after {\n  content: 'OFF';\n  color: #000;\n  position: absolute;\n  right: 10px;\n  z-index: 0;\n  font: 12px\/26px Arial, sans-serif;\n  font-weight: bold;\n  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.15);\n}\n.slideThree:before {\n  content: 'ON';\n  color: #27ae60;\n  position: absolute;\n  left: 10px;\n  z-index: 0;\n  font: 12px\/26px Arial, sans-serif;\n  font-weight: bold;\n}\n.slideThree label {\n  display: block;\n  width: 34px;\n  height: 20px;\n  cursor: pointer;\n  position: absolute;\n  top: 3px;\n  left: 3px;\n  z-index: 1;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  border-radius: 50px;\n  transition: all 0.4s ease;\n  box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3);\n}\n.slideThree input[type=checkbox] {\n  visibility: hidden;\n}\n.slideThree input[type=checkbox]:checked + label {\n  left: 43px;\n}\n\n.roundedOne {\n  width: 28px;\n  height: 28px;\n  position: relative;\n  margin: 20px auto;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n}\n.roundedOne label {\n  width: 20px;\n  height: 20px;\n  cursor: pointer;\n  position: absolute;\n  left: 4px;\n  top: 4px;\n  background: linear-gradient(to bottom, #222222 0%, #45484d 100%);\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px white;\n}\n.roundedOne label:after {\n  content: '';\n  width: 16px;\n  height: 16px;\n  position: absolute;\n  top: 2px;\n  left: 2px;\n  background: #27ae60;\n  background: linear-gradient(to bottom, #27ae60 0%, #145b32 100%);\n  opacity: 0;\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n}\n.roundedOne label:hover::after {\n  opacity: 0.3;\n}\n.roundedOne input[type=checkbox] {\n  visibility: hidden;\n}\n.roundedOne input[type=checkbox]:checked + label:after {\n  opacity: 1;\n}\n\n.roundedTwo {\n  width: 28px;\n  height: 28px;\n  position: relative;\n  margin: 20px auto;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n}\n.roundedTwo label {\n  width: 20px;\n  height: 20px;\n  position: absolute;\n  top: 4px;\n  left: 4px;\n  cursor: pointer;\n  background: linear-gradient(to bottom, #222222 0%, #45484d 100%);\n  border-radius: 50px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px white;\n}\n.roundedTwo label:after {\n  content: '';\n  width: 9px;\n  height: 5px;\n  position: absolute;\n  top: 5px;\n  left: 4px;\n  border: 3px solid #fcfff4;\n  border-top: none;\n  border-right: none;\n  background: transparent;\n  opacity: 0;\n  transform: rotate(-45deg);\n}\n.roundedTwo label:hover::after {\n  opacity: 0.3;\n}\n.roundedTwo input[type=checkbox] {\n  visibility: hidden;\n}\n.roundedTwo input[type=checkbox]:checked + label:after {\n  opacity: 1;\n}\n\n.squaredOne {\n  width: 28px;\n  height: 28px;\n  position: relative;\n  margin: 20px auto;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n}\n.squaredOne label {\n  width: 20px;\n  height: 20px;\n  position: absolute;\n  top: 4px;\n  left: 4px;\n  cursor: pointer;\n  background: linear-gradient(to bottom, #222222 0%, #45484d 100%);\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px white;\n}\n.squaredOne label:after {\n  content: '';\n  width: 16px;\n  height: 16px;\n  position: absolute;\n  top: 2px;\n  left: 2px;\n  background: #27ae60;\n  background: linear-gradient(to bottom, #27ae60 0%, #145b32 100%);\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n  opacity: 0;\n}\n.squaredOne label:hover::after {\n  opacity: 0.3;\n}\n.squaredOne input[type=checkbox] {\n  visibility: hidden;\n}\n.squaredOne input[type=checkbox]:checked + label:after {\n  opacity: 1;\n}\n\n.squaredTwo {\n  width: 28px;\n  height: 28px;\n  position: relative;\n  margin: 20px auto;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n}\n.squaredTwo label {\n  width: 20px;\n  height: 20px;\n  cursor: pointer;\n  position: absolute;\n  left: 4px;\n  top: 4px;\n  background: linear-gradient(to bottom, #222222 0%, #45484d 100%);\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px white;\n}\n.squaredTwo label:after {\n  content: '';\n  width: 9px;\n  height: 5px;\n  position: absolute;\n  top: 4px;\n  left: 4px;\n  border: 3px solid #fcfff4;\n  border-top: none;\n  border-right: none;\n  background: transparent;\n  opacity: 0;\n  transform: rotate(-45deg);\n}\n.squaredTwo label:hover::after {\n  opacity: 0.3;\n}\n.squaredTwo input[type=checkbox] {\n  visibility: hidden;\n}\n.squaredTwo input[type=checkbox]:checked + label:after {\n  opacity: 1;\n}\n\n.squaredThree {\n  width: 20px;\n  position: relative;\n  margin: 20px auto;\n}\n.squaredThree label {\n  width: 20px;\n  height: 20px;\n  cursor: pointer;\n  position: absolute;\n  top: 0;\n  left: 0;\n  background: linear-gradient(to bottom, #222222 0%, #45484d 100%);\n  border-radius: 4px;\n  box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 0.4);\n}\n.squaredThree label:after {\n  content: '';\n  width: 9px;\n  height: 5px;\n  position: absolute;\n  top: 4px;\n  left: 4px;\n  border: 3px solid #fcfff4;\n  border-top: none;\n  border-right: none;\n  background: transparent;\n  opacity: 0;\n  transform: rotate(-45deg);\n}\n.squaredThree label:hover::after {\n  opacity: 0.3;\n}\n.squaredThree input[type=checkbox] {\n  visibility: hidden;\n}\n.squaredThree input[type=checkbox]:checked + label:after {\n  opacity: 1;\n}\n\n.squaredFour {\n  width: 20px;\n  position: relative;\n  margin: 20px auto;\n}\n.squaredFour label {\n  width: 20px;\n  height: 20px;\n  cursor: pointer;\n  position: absolute;\n  top: 0;\n  left: 0;\n  background: #fcfff4;\n  background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);\n  border-radius: 4px;\n  box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);\n}\n.squaredFour label:after {\n  content: '';\n  width: 9px;\n  height: 5px;\n  position: absolute;\n  top: 4px;\n  left: 4px;\n  border: 3px solid #333;\n  border-top: none;\n  border-right: none;\n  background: transparent;\n  opacity: 0;\n  transform: rotate(-45deg);\n}\n.squaredFour label:hover::after {\n  opacity: 0.5;\n}\n.squaredFour input[type=checkbox] {\n  visibility: hidden;\n}\n.squaredFour input[type=checkbox]:checked + label:after {\n  opacity: 1;\n}\n\n* {\n  box-sizing: border-box;\n}\n\nbody {\n  background: #3498db;\n  font-family: 'Open Sans', sans-serif;\n  font-weight: 300;\n}\nbody h1, body h2, body em {\n  color: #eee;\n  font-size: 30px;\n  text-align: center;\n  margin: 20px 0 0 0;\n  -webkit-font-smoothing: antialiased;\n  text-shadow: 0px 1px #000;\n}\nbody em {\n  font-size: 14px;\n  text-align: center;\n  display: block;\n  margin-bottom: 50px;\n}\nbody .ondisplay {\n  text-align: center;\n  padding: 20px 0;\n}\nbody .ondisplay section {\n  width: 100px;\n  height: 100px;\n  background: #555;\n  display: inline-block;\n  position: relative;\n  text-align: center;\n  margin-top: 5px;\n  border: 1px solid gray;\n  border-radius: 5px;\n  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;\n}\nbody .ondisplay section:after {\n  \/*         visibility: hidden; *\/\n  content: attr(title);\n  position: absolute;\n  width: 100%;\n  left: 0;\n  bottom: 3px;\n  color: #fff;\n  font-size: 12px;\n  font-weight: 400;\n  -webkit-font-smoothing: antialiased;\n  text-shadow: 0px 1px #000;\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1626,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[16],"class_list":["post-1624","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-switch","tag-htmlcss"],"_links":{"self":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/comments?post=1624"}],"version-history":[{"count":1,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1624\/revisions"}],"predecessor-version":[{"id":1627,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/posts\/1624\/revisions\/1627"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media\/1626"}],"wp:attachment":[{"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/media?parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/categories?post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.profidev.online\/ru\/wp-json\/wp\/v2\/tags?post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}