Guest User

Untitled

a guest
Nov 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. <input type="checkbox" value="hello" id="hello" name="deletefiles[]"/>
  2. <label for="hello">hello</label>
  3.  
  4. label:hover, label:active {
  5. background:yellow;
  6. }
  7.  
  8. label:hover, label:active, input:hover+label, input:active+label {
  9. background:yellow;
  10. }
  11.  
  12. <label for="hello">
  13. <input type="checkbox" value="hello" id="hello" name="deletefiles[]"/>
  14. hello
  15. </label>
  16.  
  17. $(document).ready(function(){
  18. $('#hello, label[for="hello"]').hover(function(){$(this).addClass('.hover');},
  19. function(){$(this).removeClass('.hover');});
  20.  
  21. });
  22.  
  23. ...
  24.  
  25. .hover
  26. {
  27. background-color: yellow;
  28. }
  29.  
  30. /*CSS*/
  31. /*-------------------------------------------------*/
  32. input:not(:checked) + label:hover{
  33. color: #d51e22;
  34. cursor: pointer;
  35. background-color: #bbb;
  36. }
  37.  
  38. input:checked + label[for="tab1"],
  39. input:checked + label[for="tab2"],
  40. input:checked + label[for="tab3"],
  41. input:checked + label[for="tab4"]{
  42.  color: #d51e22;
  43.  text-shadow: 0 0.04em 0.04em rgba(0,0,0,0.35);
  44. background-color: #000;
  45. }
  46.  
  47. label[for="tab1"],[for="tab2"],[for="tab3"],[for="tab4"] {
  48. width:24%;
  49. display: inline-block;
  50. margin: 0 0 -1px;
  51. padding: 25px 25px;
  52. font-weight: 600;
  53. font-size:24px;
  54. text-align: center;
  55. border-radius:15px;
  56. background-color: #d51e22;
  57. color: #fff;
  58. /*border: 1px solid transparent;*/
  59. }
  60.  
  61. /*HTML*/
  62. /*-------------------------------------------------*/
  63. <input id="tab1" type="radio" name="tabs" checked>
  64. <label for="tab1">Text here</label>
  65.  
  66. <input id="tab2" type="radio" name="tabs">
  67. <label for="tab2">Text here</label>
  68.  
  69. <input id="tab3" type="radio" name="tabs">
  70. <label for="tab3">Text here</label>
  71.  
  72. <input id="tab4" type="radio" name="tabs">
  73. <label for="tab4">Text here</label>
Add Comment
Please, Sign In to add comment