基本上,當我打開我的網頁在不同的計算機上,我的佈局變得扭曲,有些東西從屏幕上消失,你看不到它。在另一臺計算機上打開網站時,網頁佈局會扭曲嗎?
個人電腦我設計的網站有一個比我的筆記本電腦屏幕更大的屏幕。
但是,當我縮小使用我的筆記本電腦上的網頁瀏覽器縮放功能時,所有東西然後又回到了原地......這是爲什麼?我怎樣才能解決這個問題?
如果是解決方案,我將如何使用媒體查詢?
下面是代碼:謝謝
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The Sun</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
background-color: #91928C;
font-family: 'Titillium Web', Calibri, sans-serif;
background-image:url(starfield.jpg);
background-size:cover;
}
.nav-section {
width: 100%;
padding: 20% 0;
}
nav ul {
position: relative;
left: 550px;
bottom: 350px;
width: 700px;
background-color: rgba(255, 255, 255, 0.5);
text-align: center;
border-radius: 63px;
}
nav ul li {
list-style: none;
display: inline-block;
}
nav ul li a {
display: block;
text-decoration: none;
padding: 40px 60px;
font-size: 20px;
text-transform: uppercase;
font-weight: 300;
color: #323642;
transition: background-color 0.5s ease;
}
nav ul li a:hover {
background-color: rgba(255, 255, 255, 0.3);
}
.container {
margin-left:auto;
margin-right:auto;
}
.info {
position:relative;
top: -1800px;
left:550px;
opacity:1;
width:700px;
color: #ffffff;
}
.content {
position: relative;
bottom: 690px;
left: 500px;
background-color:#000000;
height:1200px;
width: 800px;
border: 3px solid white;
opacity:0.8;
}
h1 {
color:#FFFFFF
}
</style>
</head>
<body>
<div class="nav-section">
<nav>
<ul>
<li><a href="EarthProfile.html">Earth Profile</a></li>
<li><a href="EarthInfo.html">Info</a></li>
<li><a href="EarthVideo.html">video</a></li>
</ul>
</nav>
</div>
<div class="container">
<div class="content">
</div>
</div>
<div class="info">
<center><img src = "earth.gif" height="800" width="700"></center>
<br>
<br>
<hr> </hr>
<br>
<br>
<p></p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript"></script>
</body>
</html>
你可以更具體一些,可能包括屏幕截圖或詳細描述什麼「變形」意味着什麼? 另外,歡迎<3 –
基本上由變形我的意思是一切都被錯位,所有的divs被放錯地方,它只有縮小後,你可以再次看到他們 – Azzie