私は自分のウェブサイトの真ん中にいくつかのコンテンツボックスを配置しようとしていますが、次のようなものを中心に置くときはいつでも、それは適切に中心に見えません。だから私はどのようにこれらのコンテンツボックスを適切に配置し、正しい方向に私を向けることができるか知っていますか?ありがとう。グループ内のすべてのコンテンツを中心に並べることなくグループコンテンツを整列するにはどうすればよいですか?
'top:50%; bottom:50%; 、変換:変換(-50%、-50%);これを達成する
body {
background-color: #323232;
max-width: 960px;
padding: 0;
margin: 0;
font-family: Lato;
}
nav a {
color: #fff;
text-decoration: none;
padding: 20px 25px;
display: inline-block;
}
.fixed-header, .fixed-footer {
background: #333;
color: #fff;
width: 100%;
position: fixed;
text-align: center;
z-index: 10;
background-color: #202020;
}
.fixed-header {
top: 0;
}
.fixed-footer {
bottom: 0;
padding: 20px 0px;
}
.fixed-header a:hover {
color: #c1c1c1;
}
.fixed-footer a {
color: #fff;
font-weight: lighter;
text-decoration: none;
}
.group-content {
max-width: 960px;
text-align: center;
margin-bottom: 4px;
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}
.group-content h3 {
margin-top: 10px;
font-weight: normal;
font-size: 20px;
color: white;
}
.group-content p {
margin-top: 3px;
font-weight: lighter;
font-size: 20px;
color: white;
}
.content {
width: 30%;
background-color: #202020;
display: flex;
flex-direction: column;
padding: 20px 0 20px 0;
align-items: center;
margin-top: 20px;
}
.content >* {
max-width: 200px;
text-align: center;
margin: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Kumo99.cf</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="icon" href="favicon.ico">
</head>
<body>
<div class="fixed-header">
<nav>
<a href="index.html">HOME</a>
<a href="projects.html">PROJECTS</a>
<a href="about.html">ABOUT</a>
</nav>
</div>
<div class="fixed-footer">
<a href="https://steamcommunity.com/id/kumo99">Made by Kumo © 2018</a>
</div>
<div class="group-content">
<div class="content">
<img src="https://i.imgur.com/KPHMNie.png">
<h3>Arma 3: Exile Server</h3>
<p>A project for improving the exile mod.</p>
</div>
<div class="content">
<img src="https://i.imgur.com/KPHMNie.png">
<h3>Reserved Space</h3>
<p>Reserved space for future projects</p>
</div>
<div class="content">
<img src="https://i.imgur.com/KPHMNie.png">
<h3>Reserved Space</h3>
<p>Reserved space for future projects</p>
</div>
<div class="content">
<img src="https://i.imgur.com/KPHMNie.png">
<h3>Reserved Space</h3>
<p>Reserved space for future projects</p>
</div>
<div class="content">
<img src="https://i.imgur.com/KPHMNie.png">
<h3>Reserved Space</h3>
<p>Reserved space for future projects</p>
</div>
<div class="content">
<img src="https://i.imgur.com/KPHMNie.png">
<h3>Reserved Space</h3>
<p>Reserved space for future projects</p>
</div>
</div>
</body>
</html>
おかげで、解決策がうまく働いた、しかし、私は100%に幅を変更しました。 –