Я хочу, чтобы в середине страницы находился столбец с идентичным центром объекта. идентификатор объекта: итоговый счет, а идентификатор контейнера: результаты. Я пытаюсь использовать flex, но никак не могу понять, как его отцентрировать. Я пытался использовать align-content: center и justify-content: center, но они, похоже, ничего не делают. Почему? Я прикрепил только css и html. ТАК не позволяет мне прикрепить весь код.
@import url(https://fonts.googleapis.com/css?family=Work + Sans:300, 600);
body {
font-size: 12px;
font-family: "Work Sans", sans-serif;
color: #333;
font-weight: 300;
text-align: center;
background-color: #f8f6f0;
}
h1 {
font-weight: 300;
margin: 0px;
padding: 10px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
input[type="radio"] {
height: 1.6em;
width: 1.6em;
}
button {
font-family: "Work Sans", sans-serif;
font-size: 22px;
background-color: #279;
color: #fff;
border: 0px;
border-radius: 3px;
padding: 20px;
cursor: pointer;
margin: 20px 10px;
z-index: 3;
display: block;
font-size: 2em;
}
button:hover {
background-color: #38a;
}
.question {
font-size: 3em;
margin-bottom: 10px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.answers {
margin-bottom: 20px;
text-align: left;
display: inline-block;
font-size: 3em;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.answers label {
display: block;
margin-bottom: 10px;
}
.slide {
position: static;
left: 0px;
top: 0px;
width: 100%;
z-index: 1;
display: none;
}
.active-slide {
display: block;
z-index: 2;
}
.quiz-container {
position: static;
height: auto;
margin-top: 40px;
}
#results {
display: flex;
flex-direction: column;
justify-content: center;
width: 10%;
}
#total-score {
padding-top: 10px; /* Add top padding */
padding-bottom: 10px; /* Add bottom padding */
width: 100%;
height: 100%;
background: rgb(255, 0, 0);
background: linear-gradient(
90deg,
rgba(255, 0, 0, 1) 0%,
rgba(255, 140, 0, 1) 50%,
rgba(50, 205, 50, 1) 100%
);
}
@media (min-width: 500px) {
body {
font-size: 18px;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="QuizTransition.css">
<meta name="viewport" content="width=device-width" />
</head>
<body>
<div class="container">
<div>
<h1 id="question-numer">
Intrebarea numarul:
</h1>
</div>
<div class="quiz-container">
<div id="quiz"></div>
</div>
<button id="previous">Intrebarea precedenta</button>
<button id="next">Urmatoare intrebare</button>
</div>
<div id="results">
<div id="total-score">
</div>
<div id="total-score">
</div>
<div id="total-score">
</div>
</div>
<script src="QuizLogic.js"></script>
</div>
</body>
</html>