我有一個webpage有一個簡單的形式和背景圖像。使網頁響應所有決議
頁面對不同的屏幕分辨率反應不佳,即它不響應。
這裏是頁的Screenfly看問題
我怎樣才能使這個網頁響應,適合所有屏幕?
HTML:
<!DOCTYPE html>
<html>
<head>
<title>
yes Landing Page
</title>
<link href="styles.css" type="text/css" rel="stylesheet"/>
<link href="form/stylesform.css" type="text/css" rel="stylesheet"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
</head>
<body>
<div id="content">
<img id="shadow" src="images/shadow.png"/>
<div id="bg"><img id="bg2" src="images/bgBig.png"/></div>
<div id="ul1">
<img src="images/join.png"/>
<!--<img id="shadow" src="shadow.png"/>-->
<form name="contactform" class="contact_form" method="post" name="contact_form" action="contactengine.php">
<ul>
<li>
<label for="name"></label>
<input type="text" name="Name" placeholder="name" required />
</li>
</ul>
<ul class="telephone">
<li class="telephone">
<label class="telephone" for="telephone"></label>
<input type="text" name="Tel" class="telephone" placeholder="phone" required />
</li>
</ul>
<button id="send "type="submit" name="submit1"><img src="images/submit.png"></button>
</form>
</div>
</div>
</body>
</html>
CSS:
body {
margin: 0;
width: 100%;
overflow: hidden;
}
#content{
}
#shadow {
float: left;
position: relative;
width: 1920px;
height: 397px;
margin-top: 803px;
margin-left: 0;
z-index: 11;
}
#bg {
float: left;
position: relative;
width: 1920px;
height: 841px;
margin-top: 0;
margin-left: -1920px;
z-index: 1;
background-color: #2f3a42;
background-image: -moz-linear-gradient(top, rgba(28,40,46,1) 0%, rgba(113,127,141,1) 100%),-webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(28,40,46,1)), color-stop(100%,rgba(113,127,141,1))),-webkit-linear-gradient(top, rgba(28,40,46,1) 0%,rgba(113,127,141,1) 100%),-ms-linear-gradient(top, rgba(28,40,46,1) 0%,rgba(113,127,141,1) 100%),linear-gradient(to bottom, rgba(28,40,46,1) 0%,rgba(113,127,141,1) 100%);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF1C282E',endColorstr='#FF717F8D',GradientType=0)";
}
#form {
float: left;
position: relative;
width: 591px;
height: 323px;
margin-top: 473px;
margin-left: -1562px;
z-index: 41;
}
#ul1 {
float: left;
position: relative;
width: 238px;
margin-top: 487px;
margin-left: -1342px;
z-index: 45;
min-height: 50px;
}
添加meta標籤的設備,你應該在百分比,而不是像素使用bootrap或改變寬度 – vel