I am struggling to center a section of text on my website across all screen sizes. The problem is that as the screen size increases, the text stays at the top, leaving empty space at the bottom and ruining the design.
Below, I have included the code and screenshots showing how the text remains at the top instead of being centered.
In the code, I have identified the part responsible for adjusting the padding from the top of the page. However, I am unsure how to make it center across all screen sizes. Any help would be appreciated.
body {
width: 100%;
height: 100%;
font-family: Lora,"Helvetica Neue",Helvetica,Arial,sans-serif;
color: #fff;
background-color: #000;
}
html {
width: 100%;
height: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0 0 35px;
text-transform: uppercase;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
letter-spacing: 1px;
}
p {
margin: 0 0 23px;
font-size: 18px;
line-height: 1.5;
}
@media(min-width:768px) {
p {
text-align: justify;
text-justify: inter-word;
margin: 0 0 20px;
font-size: 20px;
line-height: 1.6;
}
}
a {
color: #3bc692;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
outline: 0!important;
}
@media(min-width:768px) {
.adjust-this {
padding-left: 55px; padding-right: 55px;
}
}
.content-section {
padding-top: 85px;
}
@media(min-width:767px) {
.content-section {
padding-top: 50px; /*This is where you can adjust padding for the section*/
width: 100%;
height: 100%;
}
}
.content-section p {
opacity: 0.9;
font-family: 'Domine';
font-size: 19px;
font-weight: 500;
}
a:hover,
a:focus {
text-decoration: none;
color: #1d9b6c;
}
.greeting {
padding-top: 5px;
margin-bottom: 20px;
}
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>About</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="about.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Open Sans:400,700,400italic,700italic" rel="stylesheet" type="text/css">
</head>
<body>
<!-- About Section -->
<article id="about" class="content-section">
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1 text-left adjust-this">
<h2 class="text-center greeting">Hi there!</h2>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000
</p>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
<p>
It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
</p>
</div>
</div>
</div>
</article>
</body>