部分位置设置用的调试工具进行调整并非最完美的设置再页面缩放上会存在bug
最优化设置有待改进
页眉部分CSS代码
*{/*去除白色边框距离*/ margin: 0; padding: 0;}body{/*设置body样式*/ font-size: 14px; background-color: #F5F5F5;}.header{/*设置header标签的位置*/ margin: 25px auto; width: 1200px; margin-bottom: 20px; }/*页眉logo图*/.header .logo{/*设置logo图片还有内容分类标签对齐*/ float: left; position: relative;}/*内容分类菜单*/.header .menu{/*设置logo图片还有内容分类标签对齐*/ float: left; position: relative; margin-top: 12px;/*调整内容分类标签位置*/ margin-left: 20px; }.header .menu ul{/*设置header标签下的menu标签下的ul列表不显示*/ display: none; list-style:none;/*消除列表前面点的样式*/ width: 80px;/*不设置影响不会太大*/ position: absolute;/*设置绝对定位 破坏文档流 是得当列表显示是列表不会吧图片挤下去*/ opacity: 0.5;/*设置下拉弹出列表的透明度*/ background: white;/*背景色*/}.header .menu ul li{ font-weight: bold; margin-top: 20px; text-align: center; padding-bottom: 10px;}.header .menu .menu_title a{ text-decoration: none; /*删除a标签内原有文本的下划线*/}.header .menu .menu_title{ border-bottom: 1px solid rgba(0,0,0,.2); /*设置内容分类标签的下边框线*/ padding-bottom: 20px; /*设置内容下边框线的距离*/ width:80px; /*设置边框宽度控制下边框线的长度*/ text-align: center; /*使下边框先和文本居中显示 更加美观*/}.header .auth{ float: right;/*浮动使得注册登录选项右边排放*/}.header .auth ul li a{ text-decoration: none;}.header .auth ul li{ float: left;/*浮动使得并行*/ margin-right: 70px; margin-top: 12px;/*调整位置 为了美观*/ list-style:none; /*删除序号标点*/}
主体内容部分CSS代码
/*banner区域设置*/.banner{ width: 1200px; margin: 0 auto; margin-bottom: 80px;/*将footer部分和banner部分隔开*/}.banner ul li{ list-style:none; /*消除列表前面点的样式*/}.banner .left{ width: 600px; height: 536px; position: relative;}.banner .right{ width: 600px; height: 536px; float:right; top: -485px; /*调整位置此处时调试工具数据设置并非最优化设置有待改进*/ background-color: white; position: relative;}/*注册表格区域*/.right-big{ width: 400px; height: 450px; background-color: white; position: absolute; top: 40px; left: 100px; right: 0; bottom: 0; }/*用户注册标题*/.btn{ width: 350px; font-size: 40px; color: red; margin-top: 40px; margin-left: 15px;/*调整位置*/ border-bottom: 1px solid rgba(0,0,0,.2);/*设置下边框线*/ padding-bottom: 40px; font-weight: bold;/*标题字体加粗*/}/*输入界面*/.ider{ font-size: 20px; margin-top: 40px; margin-left: 25px;}.ider td{ height: 50px;}.yonghu{ width: 200px; height: 30px; border:1.5px solid rgba(0,0,0,0.3);/*设置输入框样式*/ -webkit-border-radius: 5px;/*设置圆角*/ border-radius: 5px; margin-left: 20px;}/*注册按钮*/input[type="submit"]{ background-color: red;/*注册按钮红色背景色*/ padding: 10px 20px 10px 20px;/*将注册按钮撑开放大显示*/ cursor: pointer;/*设置当鼠标放在登录按钮上时鼠标突变变成小手的设置*/ font-size: 20px;/*设置注册按钮内的字体大小*/ border-radius: 5px;/*设置注册按钮的边框圆角*/ color: white; margin-top: 30px; margin-left: 65px;}input[type="text"]:focus{background: #F0F8FF;/*给输入框设置获取焦点时的背景色*/}input[type="password"]:focus{background: #F0F8FF;}
页尾部分CSS代码
/*footer部分*/.footer{ width: 1200px; margin: 0 auto; border-top: 1px solid #ccc; /*因为尝试hr标签没用所以尝试设置上边框*/ position: relative;}.fuhao{ margin-left: 440px;/*将特殊符号调整位置*/ position: absolute;}.fuhao p{ float:left; /*设置浮动并排显示*/ margin-top: 30px;/*设置特殊符号的上边距*/}.hongse{ color: red;}