我正在建立一個非響應式網站,其頁眉的頁腳跨越了瀏覽器窗口的整個寬度。在寬度爲100%的DIV內部,我嵌套了寬度爲1000px的div,其中包含標題,導航和頁腳內容。Div寬度在手機瀏覽器中無法均勻調整大小
我的問題是在移動設備上瀏覽的網站時,導航和頁腳被縮放到被擊落的尺寸比所述報頭和所述網站的主區域稍小。
什麼奇怪的是,當他們與頭部沒有問題(即建有同樣的方法)導航和頁腳都受到影響。
我怎樣才能得到一切按比例縮放?整個網站和所有主要div的寬度是1000px,那麼他們爲什麼在移動設備上出現不同的尺寸?
下面是該網站的URL:http://www.test-site.co.nf
下面是一個代碼示例:
HTML:
</head>
<body>
<div id="container">
<div id="header">
<div id="header-content">
<div id="logo">
<a href="index.html"><img src="img/ama-party-rentals-logo.png" height="98" width="500"/></a>
</div>
<div id="social-icons">
<a href="" target="_blank"><img class="social" src="img/icons/facebook.png" height="40" width="40"/></a>
<a href="" target="_blank"><img class="social" src="img/icons/googleplus.png" height="40" width="40"/></a>
</div>
</div>
</div>
<div id="nav-bar">
<div id="nav">
<ul id="ul-nav">
<li><a href="">Home</a></li>
<li><a href="">Products</a></li>
<li><a href="">Company</a></li>
<li><a href="">Past Events</a></li>
<li><a href="">Contact Us</a></li>
<li><a href="">Francais</a></li>
</ul>
</div>
</div>
CSS:
#header {
background-color:#84B13F;
width:100%;
height:150px;
border-bottom-style:solid;
border-bottom-color:#648830;
border-bottom-width:5px;
}
#header-content
{
width:1000px;
height:150px;
text-align:center;
margin:auto;
background-image:url('img/top-banner.png');
}
#nav-bar
{
width:100%;
height:50px;
background-color:#84B13F;
border-bottom-style:solid;
border-bottom-color:#648830;
border-bottom-width:5px;
}
#nav
{
clear:both;
margin:auto;
height:50px;
width:1000px;
text-align:center;
}
你可以將你的代碼添加到jsFiddle,所以我們可以玩它,看看是否可以找到解決辦法? – Ismatjon
嗨,我實際上找出了答案,昨天晚上我只是無法發佈答案,直到今天,因爲我是一個新用戶。感謝您的迴應! – Jvanni
然後把你的答案和標記,以便其他人可以從中受益 – Ismatjon