gpt4 book ai didi

html - 响应式文本

转载 作者:太空宇宙 更新时间:2023-11-04 01:09:36 25 4
gpt4 key购买 nike

我在制作响应式网站时遇到了一些问题。我想让页脚像页眉一样,但我无法处理。我尝试了很多方法,但我不太擅长制作网站。如果可以的话请帮忙,我应该用什么来使页脚响应所有尺寸。

这是我的 index.html 和 style.css

    body {
font: 15px/1.5 Arial, Helvetica, sans-serif;
/*padding: 0;*/
margin: 0;
background-color: #e7e7e7;
}

.container {
width: 80%;
margin: auto;
overflow: hidden;
}

img {
padding-right: 55%;
padding-top: 22%;
/*width: 13%;*/
min-height: 10%;
}

.access {
transform: translate(-1%, -150%);
}

header {
background: #14a79d;
color: #ffffff;
text-align: center;
min-height: 70px;
margin-right: 18%;
margin-left: 18%;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}

.footer {
position: relative;
background: #14a79d;
color: #ffffff;
text-align: center;
margin-right: 10%;
margin-left: 10%;
border-bottom-left-radius: 25px;
border-bottom-right-radius: 25px;
}

.box {
text-align: center;
background-color: white;
height: 78vh;
background-size: cover;
margin-left: 10%;
margin-right: 10%;
}

/*footer {*/
/*position: fixed;*/
/*overflow: auto;*/
/*padding: 0 20px;*/
/*left: 0;*/
/*bottom: 0;*/
/*right: 0;*/
/*width: 60%;*/
/*margin-top: 100px;*/
/*color: #ffffff;*/
/*background-color: #14a79d;*/
/*text-align: center;*/
/*line-height: 50px;*/
/*padding: 0 20px;*/
/*margin-right: 18%;*/
/*margin-left: 18%;*/
/*height: 100%;*/
/*margin-top: -2%;*/
/*border-bottom-left-radius: 25px;*/
/*border-bottom-right-radius: 25px;*/
/*}*/
<header>
<div class="container">
<div id="denied">
<h1>Access Denied</h1>
</div>
</div>
</header>

<section id="boxes">
<div class="container">
<div class="box">
<img src="x.png">
<div class="access">

<h1 style="color: red;">Page Blocked</h1>

<p>You are attempting to access a forbidden Site.<br>It is blocked according to<br> the organization security policy.</p>

</div>
</div>

<div class="footer">
<p>&copy copyright ... 2018</p>
</div>
</div>

</section>

最佳答案

这个怎么样?也许将页脚从主容器中取出会有所帮助。

body {
font: 15px/1.5 Arial, Helvetica, sans-serif;
padding: 0;
margin: 0;
background-color: #f4f4f4;
}

.container {
width: 80%;
margin: auto;
overflow: hidden;
}

header {
background: #14a79d;
color: #ffffff;
text-align: center;
height: 20vh;
margin-right: 18%;
margin-left: 18%;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}

footer {
color: #ffffff;
background-color: #14a79d;
text-align: center;
margin-right: 18%;
margin-left: 18%;
height: 10vh;
border-bottom-left-radius: 25px;
border-bottom-right-radius: 25px;
}

.box {
text-align: center;
background-color: grey;
height: 70vh;
background-size: cover;
margin-left: 10%;
margin-right: 10%;
}
<!DOCTYPE html>
<html>
<head>
<title>Access Denied</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device=width">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<div class="container">
<div id="denied">
<h1>Access Denied</h1>
</div>
</div>
</header>

<section id="boxes">
<div class="container">
<div class="box">
<img src="x.png">
<div class="access">
<h1 style="color: red;">Page Blocked</h1>

<p>You are attempting to access a forbidden Site.<br>It is blocked according to<br> the organization security policy.</p>

</div>
</div>
</div>
</section>

<footer>
<div class='container'>
<p>&copy copyright ... 2018</p>
</div>
</footer>
</body>
</html>

关于html - 响应式文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51456189/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com