{"id":7643,"date":"2021-05-09T23:53:17","date_gmt":"2021-05-09T20:53:17","guid":{"rendered":"https:\/\/elzero.org\/?p=7643"},"modified":"2022-09-28T18:00:59","modified_gmt":"2022-09-28T15:00:59","slug":"tutorials-customize-radio-input","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/tutorials-customize-radio-input\/","title":{"rendered":"Customize Radio Input"},"content":{"rendered":"<h3>\u0627\u0644 Code<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-html\">\r\n<form action=\"\">\r\n  <div>\r\n    <input id=\"mac\" type=\"radio\" name=\"os\" \/>\r\n    <label for=\"mac\">Mac<\/label>\r\n  <\/div>\r\n  <div>\r\n    <input id=\"lin\" type=\"radio\" name=\"os\" \/>\r\n    <label for=\"lin\">Linux<\/label>\r\n  <\/div>\r\n  <div>\r\n    <input id=\"win\" type=\"radio\" name=\"os\" \/>\r\n    <label for=\"win\">Windows<\/label>\r\n  <\/div>\r\n<\/form>\r\n<\/script>\r\n\r\n<script type=\"text\/plain\" class=\"language-css\">\r\n* {\r\n  box-sizing: border-box;\r\n  padding: 0;\r\n  margin: 0;\r\n}\r\nbody {\r\n  font-family: Arial, Tahoma;\r\n}\r\nform {\r\n  width: 400px;\r\n  margin: 20px auto;\r\n  background-color: #f9f9f9;\r\n  padding: 15px;\r\n}\r\nform > div {\r\n  padding: 5px 0;\r\n}\r\nform input[type=\"radio\"] {\r\n  -webkit-appearance: none;\r\n  appearance: none;\r\n}\r\nform label {\r\n  position: relative;\r\n  padding-left: 25px;\r\n}\r\nform label::before {\r\n  content: \"\";\r\n  width: 16px;\r\n  height: 16px;\r\n  border: 1px solid #0075ff;\r\n  position: absolute;\r\n  left: 0;\r\n  top: 50%;\r\n  transform: translateY(-50%);\r\n  background: white;\r\n}\r\nform input[type=\"radio\"]:checked + label::after,\r\nform input[type=\"radio\"]:not(:checked):hover + label::after {\r\n  content: \"\";\r\n  background-color: #0075ff;\r\n  width: 10px;\r\n  height: 10px;\r\n  position: absolute;\r\n  left: 4px;\r\n  top: 4px;\r\n}\r\nform input[type=\"radio\"]:not(:checked):hover + label::after {\r\n  opacity: 0.2;\r\n}\r\nform input[type=\"radio\"]:checked + label {\r\n  color: #0075ff;\r\n}\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>\u0627\u0644 Code<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[879],"tags":[],"class_list":["post-7643","post","type-post","status-publish","format-standard","hentry","category-front-end-tutorials"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/7643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=7643"}],"version-history":[{"count":1,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/7643\/revisions"}],"predecessor-version":[{"id":7644,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/7643\/revisions\/7644"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=7643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=7643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=7643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}