main.css 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. *{
  2. margin: 0;
  3. padding: 0;
  4. }
  5. body{
  6. font-family:"Arial";
  7. font-size: 20pt;
  8. }
  9. h1{
  10. width: 100%;
  11. height: auto;
  12. text-align: center;
  13. }
  14. nav{
  15. display: inline-block;
  16. position: relative;
  17. width: 100%;
  18. height: auto;
  19. }
  20. nav a{
  21. display: inline-block;
  22. text-decoration: none;
  23. color: black;
  24. cursor: pointer;
  25. line-height: 1;
  26. text-align: center;
  27. }
  28. nav a:after{
  29. display: block;
  30. left: 0;
  31. width: 0;
  32. height: 3px;
  33. background-color: black;
  34. content: "";
  35. transition: width 0.3s ease-out;
  36. }
  37. nav a:hover:after,
  38. nav a:focus:after {
  39. width: 100%;
  40. }
  41. nav ul{
  42. list-style: none;
  43. padding: 0;
  44. margin: 0 auto;
  45. width: 900px;
  46. height: auto;
  47. }
  48. nav li{
  49. text-align: center;
  50. display: inline-block;
  51. padding: 0 0 20px 20px;
  52. }
  53. .sub-menu {
  54. transition: 0.3s ease;
  55. display: none;
  56. }
  57. .sub-menu:hover li{
  58. display: block;
  59. }
  60. /*Если экран меньше 800px то выполняются эти стили*/
  61. @media screen and (max-width: 800px) {
  62. nav{
  63. border-bottom: 0;
  64. }
  65. nav ul{
  66. position: relative;
  67. display: block;
  68. height: auto;
  69. left: 0;
  70. }
  71. nav a#pull{
  72. display: block;
  73. width: 100%;
  74. position: relative;
  75. }
  76. nav a#pull:after{
  77. content: "";
  78. width: 30px;
  79. height: 30px;
  80. display: inline-block;
  81. position: absolute;
  82. }
  83. nav li{
  84. height: auto;
  85. text-align: left;
  86. display: block;
  87. }
  88. }