I'm trying to vertically center a row of divs contenaining inside pictures without moving the text. I tried doing it by using align-content: center
, but it didin't work... The divs contenaining the pictures are located at the Homepage and Supports tabs.
The code:
function openTab(event, pageName) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(pageName).style.display = "block";
event.currentTarget.className += " active";
}
// Get the element with id="DefaultOpen" and click on it
document.getElementById("TabLinks_DefaultOpen").click();
body {
background-color: white;
}
h1 {
text-align: center;
}
input,
select,
textarea {
width: 100%;
padding: 6px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
padding: 12px 12px 12px 0;
display: flex;
flex-direction: column;
}
.Horizontal_Tab button {
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
background-color: inherit;
}
.Horizontal_Tab button:hover {
background-color: #ddd;
}
.Horizontal_Tab button.active {
background-color: #ccc;
}
.Horizontal_Tab {
overflow: hidden;
float: left;
border: 1px solid black;
background-color: #f2f2f2;
height: auto;
display: flex;
flex-flow: row;
width: 100%;
display: flex;
justify-content: space-around;
}
.tabcontent {
animation: fadeEffect 1s;
top: 15%;
display: flex;
justify-content: center;
}
@keyframes fadeEffect {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
._Links {
display: flex;
flex-flow: row wrap;
}
.Dapp_Links {
flex: 15%;
padding: 5px;
border: 2px solid black;
display: flex;
justify-content: center;
}
.Dapp_Links img {
width: 50%;
height: auto;
cursor: pointer;
}
.Support_Links {
flex: 30%;
padding: 5px;
border: 2px solid black;
display: flex;
justify-content: center;
}
.Support_Links img {
width: 30%;
height: auto;
cursor: pointer;
}
<body>
<div id="HorizontalTab" class="Horizontal_Tab">
<button id="TabLinks_DefaultOpen" class="tablinks" onclick="openTab(event, 'DefaultOpen')">Homepage</button>
<button id="TabLinks_OrderCreateShipStock" class="tablinks" onclick="openTab(event, 'OrderCreateShipStock')">Orders</button>
<button id="TabLinks_OrderList" class="tablinks" onclick="openTab(event, 'OrderList')">Orders list</button>
<button id="TabLinks_OrderWarehouse" class="tablinks" onclick="openTab(event, 'OrderWarehouse')">Warehouse
list</button>
<button id="TabLinks_OrderShipment" class="tablinks" onclick="openTab(event, 'OrderShipment')">Shipment
list</button>
<button id="TabLinks_OrderOutOfCompliance" class="tablinks" onclick="openTab(event, 'OrderOutOfCompliance')">Out
of compliance
list</button>
<button id="TabLinks_Support" class="tablinks" onclick="openTab(event, 'Support')">Supports</button>
</div>
<div id="DefaultOpen" class="tabcontent">
<h1>Welcome *Account*! You're now logged in as a *Position* at SupChain</h1>
<div id="Links" class="_Links">
<div id="DappLinksOrders" class="Dapp_Links">
<img src="">
</div>
<div id="DappLinksWarehouse" class="Dapp_Links">
<img src="">
</div>
<div id="DappLinksShipments" class="Dapp_Links">
<img src="">
</div>
<div id="DappLinksOutOfCompliance" class="Dapp_Links">
<img src="">
</div>
<div id="DappLinksSuppots" class="Dapp_Links">
<img src="">
</div>
</div>
</div>
<div id="OrderCreateShipStock" class="tabcontent">
<h2>Orders</h2>
</div>
<div id="OrderList" class="tabcontent">
<h2>Orders list</h2>
</div>
<div id="OrderWarehouse" class="tabcontent">
<h2>Warehouse</h2>
</div>
<div id="OrderShipment" class="tabcontent">
<h2>Shipments</h2>
</div>
<div id="OrderOutOfCompliance" class="tabcontent">
<h2>Out of compliance</h2>
</div>
<div id="Support" class="tabcontent">
<h1>A problem ? Contact us !</h1>
<div id="Links" class="_Links">
<div id="SupportLinksPhone" class="Support_Links">
<img src="">
</div>
<div id="SupportLinksEmail" class="Support_Links">
<img src="">
</div>
<div id="SupportLinksChat" class="Support_Links">
<img src="">
</div>
</div>
</div>
</body>
I thank in advance anybody who will take the time to help me.