gpt4 book ai didi

html - 页边距未正确保持在网页浏览器的 100%

转载 作者:行者123 更新时间:2023-11-28 08:50:21 24 4
gpt4 key购买 nike

所以我正在为我的软件工程类(class)开发一个应用程序,但我在固定网页宽度方面遇到了困难。这是正在运行的应用程序的云版本的链接:Link to display issue正如您所看到的,当框被重新缩放时,标题会改变大小,并在下方创建一个大的白色框,并且即使在我的显示器上显示最大尺寸时,底部也始终有一个滚动条。

html, body {
padding: 0px;
margin: 0px;
border: 0px;
height: 100%;
width: 100%;
font-size: 100%;
}
body {
display: block;
background-color: #f7f7f7;
}
body, header, footer, h1 {
font-family: 'Lato', sans-serif;
}
#wrapper {
width: 100%;
height: 100%;
margin: 50px auto;
}
.button {
width: 240px;
height: 45px;
-webkit-border-radius: 2px;
border-radius: 2px;
margin: 0 auto;
cursor: pointer;
}

.facebook {
margin-bottom: 25px;
background-color: #A0BBD6;
-webkit-transition: background-color .2s ease;
-moz-transition: background-color .2s ease;
-ms-transition: background-color .2s ease;
-o-transition: background-color .2s ease;
transition: background-color .2s ease;
}
.facebook:hover {
background-color: #88a5c2;
}
.submit {
margin-top: 20px;
background-color: #a6d7a0;
-webkit-transition: background-color .2s ease;
-moz-transition: background-color .2s ease;
-ms-transition: background-color .2s ease;
-o-transition: background-color .2s ease;
transition: background-color .2s ease;
}
.submit:hover {
background-color: #93c08e;
}
p {
text-align: center;
color: #FFFFFF;
padding: 0 300px;
font-weight: 300;
font-size: 0.8em;
}
.form {
border: thin solid #ededed;
position: relative;
margin: 30px auto;
width: 290px;
height: auto;
background-color: #ffffff;
padding: 30px 0;
-webkit-border-radius: 2px;
border-radius: 2px;
}
input[type=text] {
background: url(http://imageshack.com/a/img812/1096/y67f.png) no-repeat 15px 13px;
}

input[type=password] {
position: relative;
top: -5px;
background: url(http://imageshack.com/a/img812/6980/lcnq.png) no-repeat 15px 13px;
}

input[type=text], input[type=password] {
width: 195px;
height: 40px;
-webkit-border-radius: 2px;
border-radius: 2px;
margin: 0 auto;
display: block;
border: none;
background-color: #EBEBEB;
padding: 2px 0 2px 45px;
-webkit-background-size: 18px;
-o-background-size: 18px;
background-size: 18px;
font-size: 15px;
font-weight: 300;
color: #777;
-webkit-transition: background-color .2s ease;
-moz-transition: background-color .2s ease;
-ms-transition: background-color .2s ease;
-o-transition: background-color .2s ease;
transition: background-color .2s ease;
}

input[type=text]:focus, input[type=password]:focus {
outline: none;
background-color: #f3f3f3;
}

img {
width: 24px;
height: auto;
display: block;
margin: 0 auto;
padding: 11px 0;
}
#header {
padding-left: 50px;
position: relative;
width: 100%;
height: 50px;
font-size: 2.0em;
}
h1 {
font-size: 1.0em;
font-color: black;
}
#navigationBar {
width: 100%;
background-color: #980000;
height: 30px;
text-align: right;
}
#footer {
width: 100%;
height: 40px;
position: relative;
background-color: #980000;
min-width: 100%;
padding-bottom: 0;
}
div {
display: block;
}
a.navButton:link,a.navButton:visited {
color:#000000;
text-decoration:none;
}
a.navButton:hover,a.navButton:active {
color:#FFFFFF;
text-decoration:none;
}

最佳答案

这是因为填充宽度

在你的header上使用box-sizing: border-box

#header {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

这是一个 Fiddle .

关于html - 页边距未正确保持在网页浏览器的 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27387787/

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