用html和css创建一个最基本的网页
来源:刀刀网
1.登录页面
2.主网页
3.副网页
代码部分(主网页):
html:
css部分:
- body {
- width: 1400px;
- padding: 0;
- margin: 0 auto;
- border: 1px solid #dcd6d6;
- }
- .w {
- width: 1200px;
- margin: 0 auto;
- }
- .fl {
- float: left;
- }
- .fr {
- float: right;
- }
- .shortcut {
- height: 32px;
- background-color: #f1f1f1;
- line-height: 32px;
- }
- .shortcut ul li {
- float: left;
- list-style: none;
- margin-top: -18px;
- }
- .shortcut ul li a {
- text-decoration: none;
- }
- /* .shortcut ul li:hover {
- color: brown;
- } */
- .shortcut .fr ul li:nth-child(even) {
- width: 1px;
- height: 12px;
- background-color: #666;
- margin: -7px 15px 0
- }
- header {
- margin: 0 auto;
- width: 1200px;
- height: 150px;
- /* background-color: aquamarine; */
- }
- .logo {
- position: absolute;
- margin: 0 auto;
- top: 1px;
- margin-top: 35px;
- margin-left: 0px;
- width: 200px;
- height: 100px;
- /* background-color: burlywood; */
- }
- .logo a {
- display: block;
- margin-left: 50px;
- width: 100px;
- height: 78px;
- background-image: url(../image/3.jpg);
- background-position: -9px -9px;
- background-repeat: no-repeat;
- text-indent: -9999px;
- overflow: hidden;
- }
- .search {
- margin: -80px 450px;
- left: 4500px;
- top: 32px;
- width: 600px;
- height: 36px;
- border: 2px solid red;
- }
- button,
- input {
- font-family: "宋体";
- /* 默认有灰色边框,去掉 */
- border: 0;
- /* 蓝色边框去掉 */
- outline: none;
- font-size: 20px;
- }
- .search input {
- float: left;
- width: 500px;
- height: 36px;
- padding-left: 10px;
- }
- .search button {
- float: right;
- width: 100px;
- height: 37px;
- background-color: rgb(217, 99, 99);
- font-size: 30px;
- }
- .hotwords {
- position: relative;
- top: 112px;
- left: 450px;
- width: 630px;
- }
- .hotwords a {
- font-size: 20px;
- margin: 0 10px;
- text-decoration: none;
- color: #747a76;
- }
- .nav1 {
- width: 1400px;
- position: relative;
- margin: 0 auto;
- margin-top: 40px;
- border: 2px solid rosybrown;
- }
- .nav .dropdown {
- float: left;
- width: 300px;
- height: 50px;
- margin: -53px 0px;
- background-color: rgb(231, 171, 160);
- }
- .nav .navitems {
- float: left;
- margin: -52px 0px;
- }
- .dropdown .dt {
- width: 100%;
- height: 50px;
- text-align: center;
- line-height: 50px;
- font-size: 25px;
- /* border: solid; */
- }
- .dropdown .dd {
- position: absolute;
- width: 300px;
- height: 500px;
- margin-top: 3px;
- background-color: rgb(137, 75, 70);
- }
- .dropdown .dd ul li {
- width: 300px;
- height: 35px;
- line-height: 32px;
- list-style: none;
- margin-left: -40px;
- /* border: solid; */
- text-indent: 2em;
- }
- .dropdown .dd ul li:hover {
- background-color: #fff;
- }
- .dropdown .dd ul li a {
- font-size: 24px;
- color: #fff;
- text-decoration: none;
- }
- .dropdown .dd ul li:hover a {
- color: rgb(222, 39, 26);
- }
- .navitems {
- position: relative;
- left: 350px;
- height: 40px;
- /* background-color: aqua; */
- }
- .navitems ul li {
- margin-left: 400px;
- float: left;
- margin: 5px 20px;
- list-style: none;
- margin-top: -1px;
- }
- .navitems ul li a {
- float: left;
- text-decoration: none;
- font-size: 25px;
- color: #918484;
- }
- .navitems ul li a:hover {
- color: red;
- }
- /* footer */
- .footer {
- clear: both;
- margin-left: 100px;
- height: 600px;
- width: 1400px;
- margin: 0 auto;
- background-color: #f5f5f5;
- }
- .footer .w {
- width: 1400px;
- }
- .mod_left {
- height: 120px;
- border-bottom: 1px solid #ccc;
- }
- .mod_left ul li {
- float: left;
- margin-left: 70px;
- width: 240px;
- height: 100px;
- background-color: rgb(195, 210, 204);
- list-style: none;
- }
- .mod_left ul li h1 {
- display: block;
- margin-left: 10px;
- width: 20px;
- height: 20px;
- border-radius: 50%;
- background-color: aquamarine;
- }
- .mod_left ul li h2 {
- margin-left: 50px;
- margin-top: -50px;
- }
- .mod_left ul li p {
- font-size: 20px;
- margin-left: 30px;
- }
- .mod_right {
- height: 250px;
- }
- .mod_right ul li {
- margin-top: 10px;
- list-style: none;
- font-size: 20px;
- text-align: center;
- margin-left: 60px;
- }
- .mod_right .b {
- font-size: 26px;
- color: #747a76;
- }
- .mod_right ul {
- float: left;
- margin-left: 100px;
- }
- .mod_right ul li a {
- text-decoration: none;
- color: #918484;
- }
- .mod_right ul li a:hover {
- color: rgb(220, 39, 51);
- }
- /* .s {
- height: 300px;
- } */
- .last_top {
- width: 1400px;
- border: 1px solid #ccc;
- height: 0px;
- margin-top: 30px;
- }
- .last_top ul {
- margin-top: 40px;
- margin-left: 230px;
- }
- .last_top ul li {
- font-size: 16px;
- float: left;
- list-style: none;
- margin: 0 6px;
- }
- .last_top ul li a {
- text-decoration: none;
- color: #918484;
- }
- .last_top ul li a:hover {
- color: red;
- }
- .last_top ul li:nth-child(even) {
- height: 20px;
- width: 1px;
- background-color: #a79797;
- }
- .last_button {
- margin-top: 80px;
- margin-left: 60px;
- height: 60px;
- width: 1200px;
- color: #5c5252;
- }
- .last_button p {
- width: 1100px;
- text-align: center;
- }