Advertisement
afsarwebdev

Checkbox check and label color

Dec 20th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. //HTML
  2. <div class="ic-check-item">
  3. <label>
  4. <input type="checkbox">
  5. <span>Special Day Offer</span>
  6. <i class="input-helper"></i>
  7. </label>
  8. </div>
  9.  
  10. //CSS
  11. .ic-check-item {
  12. position: relative;
  13. }
  14. .ic-check-item label {
  15. padding-left: 32px;
  16. display: block;
  17. font-size: 20px;
  18. line-height: 1.6;
  19. font-weight: 400;
  20. }
  21. .ic-check-item input[type="checkbox"] {
  22. position: absolute;
  23. top: 6px;
  24. left: 0;
  25. z-index: 1;
  26. cursor: pointer;
  27. opacity: 0;
  28. }
  29. .ic-check-item input[type="checkbox"]:checked + .input-helper:before {
  30. border-color: #31334a;
  31. }
  32. .ic-check-item label input[type="checkbox"]:checked + span {
  33. color: #ff6f00;
  34. }
  35. .ic-check-item .input-helper:before,
  36. .ic-check-item .input-helper:after {
  37. position: absolute;
  38. content: "";
  39. transition: all 200ms;
  40. }
  41. .ic-check-item .input-helper:before {
  42. left: 0;
  43. border: 1px solid #c7c8d1;
  44. }
  45. .ic-check-item input[type="checkbox"] {
  46. width: 19px;
  47. height: 19px;
  48. margin: 0px;
  49. }
  50. .ic-check-item input[type="checkbox"]:checked ~ .input-helper:before {
  51. background-color: #ff6f00;
  52. border-color: #ff6f00;
  53. }
  54. .ic-check-item input[type="checkbox"]:checked ~ .input-helper:after {
  55. transform: scale(1);
  56. opacity: 1;
  57. }
  58. .ic-check-item .input-helper:before {
  59. top: 6px;
  60. width: 18px;
  61. height: 18px;
  62. border-radius: 2px;
  63. color: #fff;
  64. background-color: #222222;
  65. }
  66. .ic-check-item .input-helper:after {
  67. /*content: '\2713';*/
  68. /*font: normal normal normal 14px/1 FontAwesome;*/
  69. /*font-size: 13px;*/
  70. background-image: url('../images/icons/check.png');
  71. background-repeat: no-repeat;
  72. left: 4px;
  73. top: 11px;
  74. height: 18px;
  75. width: 18px;
  76. color: #fff;
  77. transform: scale(0);
  78. opacity: 0;
  79. }
  80. .ic-check-item span {
  81. font-size: 20px;
  82. color: #31334a;
  83. line-height: 1.3;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement