2018.07.17
1.表單
表單.PNG
2.input和button區(qū)別
input和button區(qū)別.PNG
3.搜索框
搜索框.PNG
input和button區(qū)別
4.margin中的小問題
margin中的小問題.PNG
margin問題.PNG
5.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
*{margin:0px;padding: 0px;}
body{
font-family: Helvetica;
color:#999;
}
.head{
width:300px;
height:60px;
margin-top:10px;
margin-left:60px;
position: relative;
}
.head-img{
position:absolute;
top:5px;
width:50px;
height:50px;
background: #f56600;
}
.head-right{
position:absolute;
color:#333;
left:60px;/*向右向下移動 使文字與圖片隔一段距離*/
top:3px;
}
.head-right p{
font-size:15px;/*讓每個人都能享受科技的樂趣 的字體大小*/
}
.beijing{
background-image: url("images6/banner.png");
position:relative;
width:100%;
height:589px;
margin-top:25px;
background-position: -250px 0;/*讓圖片左移 使圖片中的
人物從右往中間移動留下放登陸界面的位置*/
}
.container{
width:400px;
height:525px;
margin-left: auto;
margin-right: auto;
text-align:center;
background: #fff;
box-shadow: 0 0 15px 3px rgba(51, 51, 51, 0.53);
overflow: hidden;
position: absolute;
top:32px;
right:60px;
}
.header{
font-size:22px;
margin-top:30px;
margin-bottom:30px;
}
.header-left{
color:#f56600;
}
.header-middle{
color:#e0e0e0;
}
.header-right{
color:#333;
}
input{
width: 336px;
height: 30px;
padding: 8px;
outline: none;
border:1px solid #e0e0e0;
}
.input-up{
margin-bottom:15px;/*給用戶名 密碼 輸入框下間距*/
}
.input-down{
margin-bottom:20px;
}
.submit input{
width:352px;
height:50px;
background: #f56600;
color:white;
font-size: 18px;
margin-bottom: 20px;/*設置按鈕*/
}
.middle{
font-size: 16px;
margin-bottom: 120px;
}
fieldset{
border:none;/*去掉其他登陸方式的邊框*/
}
.border{
width:350px;
border-top:1px solid #e0e0e0;
margin-left:auto;
margin-right:auto;
margin-bottom:10px;/*顯示一條橫線*/
}
.AllIcon{
margin-left:40px;
margin-bottom:30px;
overflow: hidden;/*隱藏照片不需要的多余的部分*/
position:absolute;/*給下面的放圖片的div設置絕對定位*/
top:470px;
}
.AllIcon a{
width:20px;
height:20px;
display: block;/* 將擠在一行的a標簽分開*/
float:left;/*給a設置左浮動 讓其到一行去*/
background: #747474 url("images6/icons_type.png") no-repeat;
border-radius: 50%;/*讓正方形變?yōu)閳A形 用來顯示圖片*/
margin-left:50px;/*讓四個顯示f的圓形分開*/
}
.AllIcon .one{
background-position: -19px 0;
}
.AllIcon .two{
background-position: -38px 0;
}
.AllIcon .three{
background-position: -57px 0;
}
.AllIcon .four{
background-position: -85px 0;
}
.footer{
margin-top:50px;
margin-bottom:80px;
text-align:center;
position: relative;/*因為里面的圖片要絕對定位 所以其父元素要相對定位*/
}
.footer>p{
margin-top:15px;
font-size: 12px;
}
.footer img{
width:15px;
height:15px;
position:absolute;
top:50%;
left:50%;
margin-top:7px;
margin-left:-39px;/*這是一個難點 需重點注意*/
}
</style>
</head>
<body>
<div class="head">
<div class="head-img">
<img src="images6/mi-logo.png">
</div>
<div class="head-right" >
<h2>小米商城</h2>
<p>讓每個人都能享受科技的樂趣</p>
</div>
</div>
<div class="beijing">
<div class="container">
<form>
<p class="header">
<span class="header-left">賬號登陸</span>
<span class="header-middle">|</span>
<span class="header-right">掃碼登陸</span>
</p>
<input class="input-up" type="text" placeholder="郵箱/手機號/小米賬號"><br>
<input class="input-down" type="text" placeholder="密碼"><br>
<p class="submit">
<input type="submit" value="立即登陸">
</p>
<p class="middle">
<span>注冊小米賬號</span>
<span>|</span>
<span>忘記密碼?</span>
</p>
</form>
<div class="footer">
<fieldset class="border">
<legend>其他登陸方式</legend>
</fieldset>
</div>
<div class="AllIcon">
<a href="#" class="one"></a>
<a href="#" class="two"></a>
<a href="#" class="three"></a>
<a href="#" class="four"></a>
</div>
</div>
</div>
<div class="footer">
<p>
<span><a>簡體</a></span>
<span><a>|</a></span>
<span><a>繁體</a></span>
<span><a>|</a></span>
<span><a>English</a></span>
<span><a>|</a></span>
<span><a>常見問題</a></span>
</p>
<p>
小米公司版權所有-京ICP備10046444-
京公網(wǎng)安備11010802020134號-京ICP證110507號
</p>
<img src="images6/index.jpg">
</div>
</body>
</html>
.