Can anyone help me with centering the content of a bootstrap column vertically? I'm facing an issue when setting width: 100%
and height: 100%
for the overlay div. Any solutions?
Here is an example image of what I am trying to achieve:
https://i.sstatic.net/X3oJV.png
Below is the code snippet in question:
var coverSection = $(".cover-table");
$(coverSection).height($(window).height());
.cover-table {
display: table;
width: 100%;
text-align: center;
background-image: url("http://mlmconsultantsblog.com/wp-content/uploads/2010/02/man-working-on-laptop-dreamstime_7728015.jpg");
background-size: cover;
background-attachment: fixed;
color: white;
.cover-cell {
display: table-cell;
vertical-align: middle;
.overlay {
width: 100%;
height: 100%;
background-color: rgba(22, 22, 22, 0.80);
}
}
}
Note: Please run the code snippet in full page.