1

I want to show div in center screen , in fact the div tag in center but when I set more data It's move div tag to down screen

Good result

enter image description here

Bad result - not in center screen

enter image description here

CSS

/* start set fonts */
* {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
}

/* start general */
html body {
    background-color: #181333;
}

/* start container class */
.container {
    width: 100%;
    background-color: #1e1939;
    position: absolute;
    top: 50%;
    margin: auto;
}

/* start title class */
.title {
    display: block;
    margin: 5px;
    padding: 5px;
    color: #fefefe;
    text-align: center;
    letter-spacing: 5px;
}

/* start main line class */
.main_line {
    display: block;
    width: 5%;
    margin: auto;
    border: 1px solid #9d0dab;
}

/* start description class */
.description {
    width: 25%;
    display: block;
    margin: 5px auto 5px auto;
    padding: 5px;
    color: #6f64a8;
    text-align: center;
}

/* start person class
.person {
    width: auto;
    display: block;
    text-align: center;
}

.photo {
    display: inline-block;
    margin: 10px;
}
*/

HTML

<body>
<div class="container">
    <h1 class="title">OUR TEAM</h1>
    <hr class="main_line">
    <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
        labore et dolore magna aliqua. Lorem ipsum dolor sit amet et dolore aliqua.</p>
</div>
</body>

It's take space from bottom screen I want the div be in center screen everytime................................................................................

0 Answers0