部分位置设置用的调试工具进行调整并非最完美的设置再页面缩放上会存在bug

最优化设置有待改进

页眉部分CSS代码

  1. *{/*去除白色边框距离*/
  2. margin: 0;
  3. padding: 0;
  4. }
  5. body{/*设置body样式*/
  6. font-size: 14px;
  7. background-color: #F5F5F5;
  8. }
  9. .header{/*设置header标签的位置*/
  10. margin: 25px auto;
  11. width: 1200px;
  12. margin-bottom: 20px;
  13. }
  14. /*页眉logo图*/
  15. .header .logo{/*设置logo图片还有内容分类标签对齐*/
  16. float: left;
  17. position: relative;
  18. }
  19. /*内容分类菜单*/
  20. .header .menu{/*设置logo图片还有内容分类标签对齐*/
  21. float: left;
  22. position: relative;
  23. margin-top: 12px;/*调整内容分类标签位置*/
  24. margin-left: 20px;
  25. }
  26. .header .menu ul{/*设置header标签下的menu标签下的ul列表不显示*/
  27. display: none;
  28. list-style:none;/*消除列表前面点的样式*/
  29. width: 80px;/*不设置影响不会太大*/
  30. position: absolute;/*设置绝对定位 破坏文档流 是得当列表显示是列表不会吧图片挤下去*/
  31. opacity: 0.5;/*设置下拉弹出列表的透明度*/
  32. background: white;/*背景色*/
  33. }
  34. .header .menu ul li{
  35. font-weight: bold;
  36. margin-top: 20px;
  37. text-align: center;
  38. padding-bottom: 10px;
  39. }
  40. .header .menu .menu_title a{
  41. text-decoration: none;
  42. /*删除a标签内原有文本的下划线*/
  43. }
  44. .header .menu .menu_title{
  45. border-bottom: 1px solid rgba(0,0,0,.2);
  46. /*设置内容分类标签的下边框线*/
  47. padding-bottom: 20px;
  48. /*设置内容下边框线的距离*/
  49. width:80px;
  50. /*设置边框宽度控制下边框线的长度*/
  51. text-align: center;
  52. /*使下边框先和文本居中显示 更加美观*/
  53. }
  54. .header .auth{
  55. float: right;/*浮动使得注册登录选项右边排放*/
  56. }
  57. .header .auth ul li a{
  58. text-decoration: none;
  59. }
  60. .header .auth ul li{
  61. float: left;/*浮动使得并行*/
  62. margin-right: 70px;
  63. margin-top: 12px;/*调整位置 为了美观*/
  64. list-style:none; /*删除序号标点*/
  65. }

主体内容部分CSS代码

  1. /*banner区域设置*/
  2. .banner{
  3. width: 1200px;
  4. margin: 0 auto;
  5. margin-bottom: 80px;/*将footer部分和banner部分隔开*/
  6. }
  7. .banner ul li{
  8. list-style:none; /*消除列表前面点的样式*/
  9. }
  10. .banner .left{
  11. width: 600px;
  12. height: 536px;
  13. position: relative;
  14. }
  15. .banner .right{
  16. width: 600px;
  17. height: 536px;
  18. float:right;
  19. top: -485px; /*调整位置此处时调试工具数据设置并非最优化设置有待改进*/
  20. background-color: white;
  21. position: relative;
  22. }
  23. /*注册表格区域*/
  24. .right-big{
  25. width: 400px;
  26. height: 450px;
  27. background-color: white;
  28. position: absolute;
  29. top: 40px;
  30. left: 100px;
  31. right: 0;
  32. bottom: 0;
  33. }
  34. /*用户注册标题*/
  35. .btn{
  36. width: 350px;
  37. font-size: 40px;
  38. color: red;
  39. margin-top: 40px;
  40. margin-left: 15px;/*调整位置*/
  41. border-bottom: 1px solid rgba(0,0,0,.2);/*设置下边框线*/
  42. padding-bottom: 40px;
  43. font-weight: bold;/*标题字体加粗*/
  44. }
  45. /*输入界面*/
  46. .ider{
  47. font-size: 20px;
  48. margin-top: 40px;
  49. margin-left: 25px;
  50. }
  51. .ider td{
  52. height: 50px;
  53. }
  54. .yonghu{
  55. width: 200px;
  56. height: 30px;
  57. border:1.5px solid rgba(0,0,0,0.3);/*设置输入框样式*/
  58. -webkit-border-radius: 5px;/*设置圆角*/
  59. border-radius: 5px;
  60. margin-left: 20px;
  61. }
  62. /*注册按钮*/
  63. input[type="submit"]{
  64. background-color: red;/*注册按钮红色背景色*/
  65. padding: 10px 20px 10px 20px;/*将注册按钮撑开放大显示*/
  66. cursor: pointer;/*设置当鼠标放在登录按钮上时鼠标突变变成小手的设置*/
  67. font-size: 20px;/*设置注册按钮内的字体大小*/
  68. border-radius: 5px;/*设置注册按钮的边框圆角*/
  69. color: white;
  70. margin-top: 30px;
  71. margin-left: 65px;
  72. }
  73. input[type="text"]:focus{
  74. background: #F0F8FF;/*给输入框设置获取焦点时的背景色*/
  75. }
  76. input[type="password"]:focus{
  77. background: #F0F8FF;
  78. }

页尾部分CSS代码

  1. /*footer部分*/
  2. .footer{
  3. width: 1200px;
  4. margin: 0 auto;
  5. border-top: 1px solid #ccc; /*因为尝试hr标签没用所以尝试设置上边框*/
  6. position: relative;
  7. }
  8. .fuhao{
  9. margin-left: 440px;/*将特殊符号调整位置*/
  10. position: absolute;
  11. }
  12. .fuhao p{
  13. float:left; /*设置浮动并排显示*/
  14. margin-top: 30px;/*设置特殊符号的上边距*/
  15. }
  16. .hongse{
  17. color: red;
  18. }