I am designing a website using bootstrap with a 100% height and 100% width image at the first page. Now I added some text and two buttons above the image and want to horizontal and vertical align. I found several solutions for this here on Stackoverflow. But sadly none of them worked in my case (only the horizontal center worked). So here is my code, I hope you guys can find a solution...
#Startseite {
background: url(http://qnimate.com/wp-content/uploads/2014/03/images2.jpg) no-repeat center center fixed;
width: 100%;
position: relative;
height: 100%;
background-size: cover;
text-align: center;
display: table;
vertical-align: middle;
}
.CentermiddleStart {
display: inline-block;
}
#Startseite #button-right{
text-align: right;
}
#Startseite #button-left{
text-align: left;
}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div id="Startseite">
<div class="container CentermiddleStart">
<div class="row">
<div class="col-12">
<h1>Header</h1>
<h3>Subheader</h3>
</div>
</div>
<div class="row">
<div class="col-xs-6" id="button-right">
<a href="#" class="btn btn-default btn-lg">Get started</a>
</div>
<div class="col-xs-6" id="button-left">
<a href="#" class="btn btn-default btn-lg">Get started</a>
</div>
</div>
</div>
</div>
</body>
So the image should be full size of the view and the buttons and text centered