2 回答

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超8個(gè)贊
如果您正在尋找移動(dòng)設(shè)備和桌面設(shè)備上的完全響應(yīng)式屏幕,我會(huì)使用 CSS Flex 框和/或 Bootstrap 之類的東西。它們可以幫助確保容器對(duì)任何屏幕寬度的響應(yīng)能力。
.wrapper {
margin: 10px;
padding: 10px;
min-height: 100%;
}
h4 {
text-align: center;
}
.shell-container {
width: 600px;
height: 70px;
opacity: 0.3;
background: lightGrey;
border-radius: 6px;
display: flex;
flex-direction: column;
margin-left: auto;
margin-right: auto;
width: 80%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>El</title>
<!-- CSS -->
<link rel="stylesheet" href="style.css">
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"/>
</head>
<body>
<div class="wrapper fluid-container">
<h4>CONTACTO</h4>
<div class="shell-container">
<div></div>
</div>
<br>
<div class="shell-container">
<div></div>
</div>
<br>
<div class="shell-container">
<div></div>
</div>
<br>
<div class="shell-container">
<div></div>
</div>
<div>
</body>
</html>

TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個(gè)贊
您的標(biāo)簽放錯(cuò)了位置。就是這個(gè):
<!DOCTYPE html>
<html>
<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">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<link rel="stylesheet" href="style.css">
<title>Title</title>
</head>
<body>
<center>
<h4>CONTACTO</h4>
<div style="width:600px; height: 70px; opacity: 0.3; background: lightGrey; border-radius: 6px;" class="shell container">
<div></div>
</div>
<br>
<div style="width:600px; height: 70px; opacity: 0.3; background: lightGrey; border-radius: 6px;" class="shell container">
<div></div>
</div>
<br>
<div style="width:600px; height: 70px; opacity: 0.3; background: lightGrey; border-radius: 6px;" class="shell container">
<div></div>
</div>
<br>
<div style="width:600px; height: 70px; opacity: 0.3; background: lightGrey; border-radius: 6px;" class="shell container">
<div></div>
</div>
<br>
<div style="width:600px; height: 70px; opacity: 0.3; background: lightGrey; border-radius: 6px;" class="shell container">
<div></div>
</div>
<br> </section>
</center>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>
- 2 回答
- 0 關(guān)注
- 157 瀏覽
添加回答
舉報(bào)