Advertisement
asadsuman

CSS-Tips-Trick-Part1

Jan 25th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. <!-- CSS Tips and Tricks Part One(Selection,Drop cap, Check box, Radio button,Forms Element) ----->
  2. 1. font:font-style font-weight font-size/line-height font-family;
  3. 2. padding:0px 0px 0px 0px;
  4. 3. marging:0px 0px 0px 0px;
  5. 4. ::seclection{
  6. Your css goes here
  7. }[Note we need to use declare browser pre-fix ]
  8. 5. Declare Total font-family for the site
  9. body{font-family:Helvetica,Arial,"Lucia Grande",sans-serif}
  10.  
  11. 6.Drop Cap
  12. p:first-child:first-letter{Your css goes here }
  13.  
  14. 7./*Place Holder styling */
  15. ::-webkit-input-placeholder{
  16. color:blue;
  17. }
  18. ::-moz-placeholder{
  19. color:blue;
  20. }
  21. ::-ms-input-placeholder{
  22. color:blue;
  23. }
  24.  
  25. 8./*Remove dotted when click the link or element, remove the outline */
  26. a:focus{
  27. outline:0;
  28. }
  29. input[type="text"]{
  30. outline:0;
  31. }
  32.  
  33. 9. customization of form Elements
  34.  
  35. /*Customize check-box*/
  36. input[type="checkbox"] , input[type="radio"]{
  37. display:none;
  38. }
  39. input[type="checkbox"] + label:before{
  40. display:inline-block;
  41. background:#fff;
  42. content:"";
  43. border:1px solid #ccc;
  44. font-size:12px;
  45. height:16px;
  46. width:16px;
  47. line-height:16px;
  48. vertical-align:middle;
  49. margin:-2px 6px 0 0;
  50. text-align:center;
  51. }
  52. input[type="checkbox"]:checked + label:before{
  53. content:"\2713";
  54. }
  55. /*Radio Buttons */
  56. input[type="radio"] + label:before{
  57. display:inline-block;
  58. background:#fff;
  59. content:"";
  60. border:1px solid #ccc;
  61. font-size:24px;
  62. height:12px;
  63. width:12px;
  64. border-radius:6px;
  65. line-height:12px;
  66. vertical-align:middle;
  67. margin:-2px 6px 0 0;
  68. text-align:center;
  69. }
  70. input[type="radio"]:checked + label:before{
  71. content:"\2022";
  72. }
  73.  
  74. 10. Form Element styling Tips and Tricks
  75.  
  76. input[type="text"],
  77. textarea{
  78. border:1px solid #ccc;
  79. border-radius:3px;
  80. padding:.5em;
  81. outline:none;
  82. transition: box-shadow .2s ease-in-out;
  83. }
  84. label{
  85. display:block;
  86. }
  87.  
  88. input[type="text"]:hover,
  89. textarea:hover{
  90. box-shadow:0 0 3px rgba(116,185,239,.5 );
  91. transition: box-shadow .2s ease-in-out;
  92. }
  93. /*Focus*/
  94. input[type="text"]:focus,
  95. textarea:focus{
  96. box-shadow:0 0 3px rgba(116,185,239,1);
  97. border-color:#74b9ef;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement