Advertisement
asadsuman

CSS-Tips-Trick-Part-3

Jan 25th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <!--CSS Tips and Tricks Part-3 Shapes--->
  2.  
  3. 1. Triangle
  4. .down{
  5. border-left:10px solid transparent;
  6. border-right:10px solid transparent;
  7. border-top:17px solid red;
  8. }
  9. .left{
  10. border-top:10px solid transparent;
  11. border-bottom:10px solid transparent;
  12. border-right:17px solid blue;
  13. }
  14. .right{
  15. border-top:10px solid transparent;
  16. border-bottom:10px solid transparent;
  17. border-left:17px solid #000;
  18.  
  19. }
  20.  
  21. How to create same size triangle:
  22.  
  23. Here is a Formula
  24. /*Formula for same size triangle
  25. (border-left-width + border-right-width)*0.866 */
  26. Example for up : (10+10)*0.866===17.32
  27.  
  28. 2. List item styling
  29. .list-1 li:before{
  30. content:"";
  31. display:inline-block;
  32. height:0;
  33. width:0;
  34. border-color:transparent #111;
  35. border-style:solid;
  36. border-width:4px 0 4px 6px;
  37. margin:0 .5em 0 0;
  38. }
  39. .list-2 li:before{
  40. content:"";
  41. display:inline-block;
  42. width:8px;
  43. height:8px;
  44. border-radius:4px;
  45. margin:0 .5em 1px 0;
  46. background:#ff0000;
  47. }
  48.  
  49. 3. Selecting ODD or EVEN Rows in a HTML table or List Items in CSS
  50. tr:nth-child(odd){your css goes here}
  51. tr:nth-child(even){your css goes here}
  52. li:nth-child(2n){your css goes here}[Here 2n== Even]
  53. li:nth-child(2n+1){your css goes here}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement