6.小海豹.css 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. }
  5. h3 {
  6. width: 960px;
  7. height: 50px;
  8. background: #ccc;
  9. color: #000;
  10. text-align: center;
  11. line-height: 50px;
  12. margin-bottom: 10px;
  13. }
  14. #img1 {
  15. width: 960px;
  16. margin: 24px auto 38px;
  17. display: block;
  18. }
  19. #img2,#img3 {
  20. display: none;
  21. }
  22. .main {
  23. width: 960px;
  24. margin: 10px auto;
  25. overflow: hidden;
  26. }
  27. .left {
  28. width: 630px;
  29. height: 300px;
  30. background: #f00;
  31. float: left;
  32. }
  33. .right {
  34. width: 320px;
  35. height: 300px;
  36. background: #00f;
  37. float: right;
  38. }
  39. @media screen and (max-width:480px) {
  40. #img1,#img2 {
  41. display: none;
  42. }
  43. #img3 {
  44. width: 100%;
  45. display: block;
  46. }
  47. .main {
  48. width: 100%;
  49. }
  50. .left {
  51. width: 100%;
  52. }
  53. .right {
  54. width: 100%;
  55. }
  56. h3 {
  57. width: 100%;
  58. }
  59. }
  60. @media screen and (min-width:960px) {
  61. #img1,#img3 {
  62. display: none;
  63. }
  64. #img2 {
  65. width: 100%;
  66. display: block;
  67. }
  68. .main {
  69. width: 100%;
  70. }
  71. .left {
  72. width: 63%;
  73. }
  74. .right {
  75. width: 32%;
  76. }
  77. h3 {
  78. width: 100%;
  79. }
  80. }