gpt4 book ai didi

html - 为什么我不能移动背景?

转载 作者:可可西里 更新时间:2023-11-01 13:47:23 25 4
gpt4 key购买 nike

我正在尝试制作一个简单的首页,但突然间我不能再移动我的背景了。用填充试过,但我无法解决。可能是因为我刚开始接触代码吧,哈哈!所以我想做的是:我想移动我的容器> background-color: rgba(98, 97, 99, 0.25); 更多到中心,这样它就在两边。出于某种原因,代码在这里没有正确显示,但对我来说是。可能是因为我使用的是 Bootstrap。

body html {
margin: 0;
padding: 0;
}

.container {
background-color: rgba(98, 97, 99, 0.25);
padding-top: 4%;

}


.wrap{
width: 1090px;

}
video {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
min-width: 100%;
min-height: 100%;
z-index: -100;
}

.wowImg {
height: 255px;
width: 255px;
border-top: solid black 9px;
border-bottom: solid black 9px;
border-left: solid black 9px;
float: left;
}

.venom {
height: 255px;
width: 255px;
border-bottom: solid black 9px;
border-left: solid black 9px;
float: left;
}

.overwatch {
height: 255px;
width: 255px;
border-top: solid black 9px;
border-bottom: solid black 9px;
border-right: solid black 9px;
border-left: solid black 9px;
float: left;
}

.sum41 {
height: 255px;
width: 255px;
border-bottom: solid black 9px;
border-right: solid black 9px;
border-left: solid black 9px;
float: left;
}

.middle {
height: 510px;
width: 550px;
border-top: solid black 9px;
border-bottom: solid black 9px;
border-left: solid black 9px;
float: left;
}

.whileSheSleeps {
height: auto;
width: 540px;
border-bottom: solid black 9px;
border-left: solid black 9px;
border-right: solid black 9px;
float: left;
}

.monster {
height: 284px;
width: 250px;
border-bottom: solid black 9px;
border-left: solid black 9px;
border-right: solid black 9px;
float: left;
}

.css_awesome {
height: 284px;
width: 285px;
border-bottom: solid black 9px;
border-left: solid black 9px;
border-right: solid black 9px;
float: left;
}
<!DOCTYPE html>
<html lang="en">
<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>homepage</title>
<link href="index.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">

<div class="row col-md-12 wrap">
<div class="row">
<div class="col-md-12">
<div class="wrap">


<div class="row col-md-3 upperLeft">
<div class="row">
<div class="col-md-12">
<img class="wowImg"img">
<img class="venom" src="img">
</div>
</div>
</div>

<div class="col-md-6 Middle">
<div class="row">
<div class="col-md-12">
<img class="middle" src "img">
</div>
</div>
</div>

<div class="row col-md-3 upperRight">
<div class="row">
<div class="col-md-12">
<img class="overwatch" src="img">
<img class="sum41" src="img">
</div>
</div>
</div>

<div class="row col-md-6 bottomLeft">
<div class="row">
<div class="col-md-12">
<img class="whileSheSleeps" src="img">
</div>
</div>
</div>

<div class="row col-md-3 bottomMid">
<div class="row">
<div class="col-md-12">
<img class="monster" src="img">
</div>
</div>
</div>
<div class="row col-md-3 bottomRight">
<div class="row">
<div class="col-md-12">
<img class="css_awesome" src="img">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</body>
</html>

最佳答案

.container {
background-color: rgba(98, 97, 99, 0.25);
padding-top: 4%;
width: 960px;
margin: 0 auto;
}

关于html - 为什么我不能移动背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40275890/

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