Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.69 KB | None | 0 0
  1. div {
  2.     width: 50px;
  3.     height: 50px;
  4.     position: absolute;
  5.     top: 100px;
  6. }
  7.  
  8. div:first-of-type {
  9.     background-color: blue;
  10.     left: 100px;
  11. }
  12.  
  13. div:nth-of-type(2) {
  14.     background-color: green;
  15.     left: 250px;
  16. }
  17.  
  18. div:nth-of-type(3) {
  19.     background-color: red;
  20.     left: 400px;
  21. }
  22.  
  23. div:last-of-type {
  24.     background-color: purple;
  25.     left: 550px;
  26. }
  27.  
  28. p:nth-child(n +2 ) {
  29.     color: red;
  30. }
  31.  
  32.  
  33. /*
  34. first-child
  35. last-child
  36. nth-child(3)  ////////////   в скобках можно писать: n, 4,  3n, n + 2
  37. nth-last-child(3)
  38.  
  39. first-of-type
  40. last-of-type
  41. nth-of-type(2)
  42. nth-last-of-type(2)
  43.  
  44. hover
  45. focus
  46.  
  47. not() /////// в скобках можно писать любой селектор
  48. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement