styles.css 718 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* :hover, :active, :visited */
  2. a {
  3. color: red;
  4. text-decoration: none;
  5. }
  6. a:hover {
  7. color: green;
  8. text-decoration: underline;
  9. transition: all 2s;
  10. }
  11. a:active {
  12. background: yellow;
  13. }
  14. a:visited {
  15. color: blue;
  16. }
  17. /* :target, :not(), :empty */
  18. h2 {
  19. display: inline-block;
  20. }
  21. p {
  22. display: none;
  23. }
  24. p:target {
  25. display: block;
  26. }
  27. .box {
  28. width: 100px;
  29. height: 100px;
  30. background: red;
  31. display: inline-block;
  32. margin: 1em;
  33. border-radius: 20px;
  34. }
  35. .container:hover .box:not(:hover) {
  36. opacity: 0.3;
  37. }
  38. .square {
  39. padding: 2em;
  40. background: green;
  41. display: inline-block;
  42. border-radius: 20px;
  43. margin: 1em;
  44. }
  45. .square:empty {
  46. display: none;
  47. }