@import url('https://fonts.googleapis.com/css?family=Exo:400,700'); html, body { height: 100%; margin: 0; padding: 0; } body { display: flex; align-items: center; font-family: 'Exo', sans-serif; border: 6px solid green; box-sizing: border-box; } * { box-sizing: border-box; } .container { border: 6px solid red; flex-grow: 1; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; } .domain-container { border: 6px solid blue; } .show-case-domains-container { border: 6px solid yellow; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2vh; width: 100%; height: 100%; } .show-case-domain { border: 6px solid purple; display: flex; flex-direction: column; justify-content: center; align-items: center; } /* Media Query for Landscape Mode */ @media (orientation: landscape) { body { justify-content: flex-start; /* Align to the top */ } .container, .domain-container, .show-case-domains-container { width: auto; /* Allow the containers to adjust based on content */ max-width: calc(100% - 12px); /* Account for the borders */ } } @media (max-width: 767px) { .container, .domain-container, .show-case-domains-container { width: auto; /* Allow the containers to adjust based on content */ max-width: calc(100% - 12px); /* Account for the borders */ } .show-case-domains-container { grid-template-columns: repeat(2, 1fr); } }