gpt4 book ai didi

html - 为什么我的网站左边有一大片空间?

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

在浏览器中网站的 html 左侧出现了一个非常宽的空间。我不知道原因,甚至不知道这是什么时候发生的。我在这里上传了我的网站:http://kfs-saintgeorge.esy.es/

这是我的 CSS 文件:

*{
box-sizing: border-box;

}

html{
direction: rtl;
background-color: #b7b7b7;
margin: 0 auto;
padding: 0;
}

img{
max-width:100%;
}

body{
width: 60%;
margin: auto;
padding: 0;
}

div{
border-radius: 10px;
}

.centering{
text-align: center;
}


#hbackground{
background: url('/images/background.jpg') no-repeat ;
background-size: cover;
display: block;
border-radius: 20px 20px 0px 0px;
margin: 10px auto;
width: 100%;
padding-top:37.01527614571093%;

}

.btop{
border-radius: 0;
height: 4px;
width: 100%;
}

#header ul{
list-style-type: none;
margin: 0;
padding: 0;
background-color: #1e7989;
font-family: hfont;
font-size: 20px;
display: flex;
justify-content: space-around;
z-index: 1;
margin:10px auto;
width: 100%;
}

#header li{
width: 9em;
height: 70px;
background-color: #1e7989;
flex: 1 1 auto;
}


#header li a{
display: block;
line-height: 70px;

}

.content {
background-color: #ffffff;
width:100%;
text-align: center;
line-height: 2em;
line-height: 50px;
}

.content p {
width: 85%;
margin:0 auto;
font-family: contentfont;
font-weight: bold;
font-size: 23px;
color:#862222;
}

a:link, a:visited{
text-decoration: none;
color:#ffffff;
}


h2{
color:#187477;
font-family: headlinefont;
font-weight: normal;
text-decoration: underline;
text-align: center;
}

.mainmenu {
cursor: pointer;
color:#ffffff;
text-align: center;
display: block;
margin-bottom: 0;
bottom: 0;
border:0;
font-size: 1em;
font-weight: bold;
width: 100%;
}

.submenu {
list-style-type: none;
padding: 0;
text-align: center;
background-color: #17243e;
margin: 0 auto;
display: none;
border-radius: 0 0 7px 7px;
}

.submenu li {
border-bottom: 2px solid white;
}

.submenu li:last-child, .submenu li:last-child a:last-child {
border-bottom: 0;
border-radius: 0 0 7px 7px;

}

.submenu a:hover {
background-color: aliceblue;
color: #000000;
}


nav{
width: 29%;
display: inline;
}

nav div{
margin-bottom: 10px;
background-color: #ffffff;
padding: 10px;
max-width: 100%;
}

#sidebar{
background-color: white;
padding: 0;
font-family: contentfont;
}

#sidebar>ul{
list-style-type: none;
margin: 0;
padding: 20px;

}

#sidebar>ul >li{
position: relative;
background-color: #1a8891;
border:2px solid #0c383a;
margin-bottom: 5px;
border-radius: 10px;
}

#sidebar a:link,#sidebar a:visited{
display: block;
position: relative;
width: 100%;
text-align: center;
line-height: 40px;
font-size: 1em;
font-weight: normal;
}

#sidebar li:hover{
background-color: #156b72;
}

#body2{
width: 100%;
display: flex;
justify-content: space-around;
align-items:flex-start;
flex-direction: row;
}

#main_content{
width: 70%;
vertical-align: top;
}

#footer{
background-color: #05333b;
width: 100%;
height: 100px;
text-align: center;
color:#ffffff;
font-family: Arial;
line-height: 20px;
border-radius: 0px;
margin: auto;
display: block;
bottom: 0;
right: 0;

}

#footer p{
position: relative;
top: 50%;
transform: translateY(-50%);
}

#cp_widget_e6374685-0d11-4dc4-9b95-04f8435cd872{
margin: 0 auto;
padding: 10px;
}

#homeImages{
background-color: white;
margin: auto;
text-align: center;

}

.mainmenu i{
position: absolute;
right: 10%;
top:10px;
vertical-align: middle;
}

@media screen and (max-width: 1200px){
body{
width: 100%;
}

header ul{
font-size: 5px;
}
}

#social{
direction: ltr;
height: auto;
margin: auto;
display: flex;
justify-content: center;
margin-bottom: 10px;
flex-wrap: wrap;
}

.social{
color:black;
padding: 3px;
}

.fb:hover{
color:#000098;
}

.yt:hover{
color: #ff0000;
}

#facebook-page{
max-width: 100%;
padding: 0;
text-align: center;
overflow: hidden;
}

.fb-page{
margin: auto;
text-align: center;
max-width: 100%;
padding: 0;
}

最佳答案

据我所知是因为direction: rtl 标记在您的 HTML 元素中。

尝试把它放在#body2中:

#body2 {
width: 100%;
display: flex;
justify-content: space-around;
align-items: flex-start;
flex-direction: row;
direction: rtl;
}

关于html - 为什么我的网站左边有一大片空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32148112/

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