I am building a page based on bootstrap5, yet I am having a problem in the positioning of the footer and the main content container.
The page was working fine until I added the footer:
before footer picture:
after footer picture:
I am providing a simplified code as a snippet here (all mages and some styles are broken, but notice the overflow at the bottom of the page):
#import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Arimo&display=swap');
:root {
--top-header-top-position: 0rem;
--header-height: 3.5rem;
--nav-width: 68px;
--chat-width: 100px;
--primary-color: var(--bs-primary);
--secondary-color: var(--bs-secondary);
--field-gray: var(--bs-field-grey);
--field-grey-transparency: var(--bs-field-grey-transparency);
--white-color: var(--bs-white);
--body-font: 'Arimo', 'Montserrat', sans-serif;
--normal-font-size: 1rem;
--z-fixed: 51;
--z-lnavbar: 50;
--z-chat: 50;
--z-topbar: 51;
}
*,
::before,
::after {
box-sizing: border-box
}
.modal-backdrop {
z-index: 100000 !important;
}
.modal {
z-index: 100001 !important;
}
.top-header {
width: 100%;
height: var(--top-header-top-position);
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
background-color: var(--secondary-color);
z-index: var(--z-topbar);
transition: .5s;
text-align: center !important;
}
.header {
width: 100%;
height: var(--header-height);
position: fixed;
top: var(--top-header-top-position);
left: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
background-color: var(--primary-color);
z-index: var(--z-fixed);
transition: .5s
}
.main-container-page {
padding-top: calc(var(--header-height) + var(--top-header-top-position) + 5rem);
z-index: 5000;
}
.header_toggle {
color: var(--primary-color);
font-size: 1.5rem;
cursor: pointer;
}
.header_img {
width: 35px;
height: 35px;
display: flex;
justify-content: center;
border-radius: 50%;
overflow: hidden
}
.header_img img {
width: 40px
}
#account-icon:hover {
color: var(--white-color);
}
.l-navbar {
position: fixed;
top: 0;
left: -30%;
width: var(--nav-width);
height: 100vh;
background-color: var(--primary-color);
padding: .5rem 1rem 0 0;
transition: .5s;
z-index: var(--z-lnavbar);
}
.r-navbar {
position: fixed;
top: 0;
right: 0;
width: 0;
height: 100vh;
background-color: var(--primary-color);
padding: 1rem 0 0 1rem;
transition: .5s;
z-index: 5000;
padding: 1rem 0 0 1rem;
}
.nav {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
margin-top: 5rem;
}
.nav_logo,
.nav_link {
display: grid;
grid-template-columns: max-content max-content;
align-items: center;
column-gap: 1rem;
padding: .5rem 0 1.5rem 2rem;
text-decoration: none;
}
.nav_link {
position: relative;
color: var(--white-color);
margin-bottom: 0rem;
transition: .3s
}
.nav_logo {
margin-bottom: 3rem
}
.nav_logo-icon {
font-size: 1.25rem;
color: var(--white-color)
}
.nav_logo-name {
color: var(--white-color);
font-weight: 700
}
.nav_link:hover {
color: var(--secondary-color) !important;
}
.nav_icon {
margin-left: -1rem;
font-size: 1.2rem;
}
.nav_name {
margin-left: -0.5rem;
font-size: 1rem;
}
.secondary-bs-color {
color: var(--bs-secondary)
}
.white-bs-color {
color: var(--white-color)
}
.show-left-nav {
left: 0;
width: calc(var(--nav-width) + 156px);
}
.show-right-nav {
width: 100%;
}
.body-chat-pd {
padding-right: calc(var(--chat-width) + 1rem);
}
.chat-font {
font-size: small;
}
.time-span-chat {
font-size: smaller;
color: var(--white-color);
}
#chatContainer {
-ms-overflow-style: none; /* for Internet Explorer, Edge */
scrollbar-width: none; /* for Firefox */
overflow-y: scroll;
}
#chatContainer::-webkit-scrollbar {
display: none; /* for Chrome, Safari, and Opera */
}
.active {
font-weight: bold;
color: var(--secondary-color);
}
.active::before {
content: '';
position: absolute;
left: 0;
width: 2px;
height: 32px;
background-color: var(--secondary-color)
}
.height-100 {
height: 100vh
}
.float-icon-chat {
width: 60px;
height: 60px;
bottom: 40px;
right: 40px;
background-color: var(--secondary-color);
color: var(--white-color);
border-radius: 50px;
text-align: center;
vertical-align: middle;
z-index: 100;
}
.coin-dropdown-item {
color: var(--white-color);
}
.coin-dropdown-item:hover {
color: var(--secondary-color);
background-color: var(--field-grey-transparency);
font-weight: bold;
}
#media screen and (min-width: 768px) {
.header {
height: calc(var(--header-height) + 1rem);
padding: 0 2rem 0 1.5rem;
}
.header_img {
width: 40px;
height: 40px
}
.header_img img {
width: 45px
}
.l-navbar {
left: 0;
padding: 1rem 1rem 0 0
}
.r-navbar {
right: 0;
padding: 1rem 0 0 1rem;
width: 0;
}
.show-left-nav {
width: calc(var(--nav-width) + 188px)
}
.body-menu-pd {
padding-left: calc(var(--chat-width) + 188px)
}
.show-right-nav {
width: calc(var(--chat-width) + 188px)
}
.body-chat-pd {
padding-right: calc(var(--chat-width) + 192px)
}
}
/* Media queries for conditional borders on games */
.game-col {
border-left: none;
}
.game-block {
border-bottom: none;
}
.game-top {
border-top: 1px solid var(--white-color);
}
#media (min-width: 576px) {
.game-col {
border-left: 1px solid var(--white-color);
}
.game-block {
border-bottom: 1px solid var(--white-color);
}
.game-top {
border-top: none;
}
}
/* crash game */
.crash-canvas {
height: 90%;
width: 100%;
max-width: 750px;
border-radius: 7px;
background-color: #0f1923;
margin: 0rem auto 2rem auto;
}
/* betting menu */
.bet-menu-buttons {
border-radius: 0.8rem;
width: 55px;
height: 50px;
font-size: 1.0rem;
color: rgba(255, 255, 255, 0.5);
display: flex;
justify-content: center;
align-items: center;
background-color: #262833;
color: #fff;
}
.crash-result {
border-radius: 0.8rem;
width: 40px;
height: 35px;
font-size: 0.7rem;
color: rgba(255, 255, 255, 0.5);
display: flex;
justify-content: center;
align-items: center;
background-color: #262833;
color: #fff;
}
.bettor-table-item {
border-bottom: 1px solid var(--white-color);
}
.bet-box1 {
border-left: 0.5px solid var(--field-grey-transparency);
border-top: 0.5px solid var(--field-grey-transparency);
border-right: 0.0px solid var(--field-grey-transparency);
border-bottom: 0.5px solid var(--field-grey-transparency);
}
.bet-box2 {
border-left: 0.0px solid var(--field-grey-transparency);
border-top: 0.5px solid var(--field-grey-transparency);
border-right: 0.0px solid var(--field-grey-transparency);
border-bottom: 0.5px solid var(--field-grey-transparency);
}
.bet-box3 {
border-left: 0.5px solid var(--field-grey-transparency);
border-top: 0.5px solid var(--field-grey-transparency);
border-right: 0.5px solid var(--field-grey-transparency);
border-bottom: 0.5px solid var(--field-grey-transparency);
}
.bet-box3:focus {
border-left: 0.5px solid var(--field-grey-transparency);
border-top: 0.5px solid var(--field-grey-transparency);
border-right: 0.5px solid var(--field-grey-transparency);
border-bottom: 0.5px solid var(--field-grey-transparency);
}
/* pre-footer */
.pre-footer {
height: 700px;
}
#media (min-width: 576px) {
.pre-footer {
height: 200px;
}
.footer-padding {
padding-left: var(--nav-width);
}
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!--Container Main start-->
<div class="height-100 main-container-page">
<div class="container h-100">
<div class="row gx-0">
<div class="col-12 col-sm-5 order-sm-1 order-2 bg-transparent text-center game-top pt-5 pb-5 ps-5 pe-5 d-flex flex-column justify-content-evenly">
<div class="input-group mb-3 pb-3">
<span class="bet-box1 bg-primary text-white fw-bold input-group-text">Amount</span>
<span class="bet-box2 bg-primary text-white fw-bold input-group-text">TC</span>
<input type="text" class="bet-box3 bg-primary text-white form-control" placeholder="select value here" aria-label="Dollar amount (with dot and two decimal places)">
</div>
<div class="d-flex justify-content-between mb-3 pb-3">
<div class="bet-menu-buttons bg-primary text-white border border-field-grey-transparency">
2x
</div>
<div class="bet-menu-buttons bg-primary text-white border border-field-grey-transparency">
10x
</div>
<div class="bet-menu-buttons bg-primary text-white border border-field-grey-transparency">
1/2
</div>
<div class="bet-menu-buttons bg-primary text-white border border-field-grey-transparency">
+5
</div>
<div class="bet-menu-buttons bg-primary text-white border border-field-grey-transparency">
+10
</div>
</div>
<div class="d-block flex-column justify-content-center align-items-start mb-3 pb-3">
<span class="text-white fw-bold">
Select your side
</span>
</div>
<div class="d-block justify-content-arround h-100 w-100 mb-3 pb-3">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin1.png" alt="coin1">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin2.png" alt="coin2">
</div>
<div class="d-flex flex-column mb-3 pb-3">
<button class="btn btn-secondary fw-bold border border-secondary rounded-pill">Bet</button>
</div>
<div class="d-flex justify-content-between pt-3">
<div class="d-block ps-3">
<i class="fas fa-expand fa-2x text-white"></i>
</div>
<div class="d-flex pe-3">
<div class="d-block">
<i class="fas fa-history fa-2x text-white"></i>
</div>
<div class="d-block ps-3">
<i class="fas fa-volume-mute fa-2x text-white"></i>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-7 order-sm-2 order-1 bg-transparent text-center game-col pb-5">
<div class="d-block h-80 game-block pt-4 ps-4 pe-4">
<div class="d-block h-3 ps-5 pt-3 pb-5">
<div class="d-flex bg-transparent w-92 position-relative" style="height: 22px;">
<span class="position-absolute w-100 start-0 text-white fw-bold">Girando em 00:20</span>
<div id="time-bar" class="d-flex border border-0 border-primary rounded-pill bg-secondary ps-1 pe-1 pt-1 pb-1" style="height: 22px; width: 5%;"></div>
</div>
</div>
<div class="d-flex">
<div class="coin" id="coin" data-spin="tails">
<div class="coin__front"></div>
<div class="coin__edge">
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
</div>
<div class="coin__back"></div>
<div class="coin__shadow"></div>
</div>
</div>
</div>
<div class="d-flex flex-column h-35 game-top ps-3 pt-3 pb-5">
<div class="d-flex text-white fw-bold ms-1 mb-2">
Last runs:
</div>
<div class="d-flex justify-content-start">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin1.png" alt="coin1" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin2.png" alt="coin2" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin1.png" alt="coin1" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin2.png" alt="coin2" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin1.png" alt="coin1" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin2.png" alt="coin2" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin1.png" alt="coin1" style="min-width: 0;">
<img class="coin-bet-button ps-2 pe-2" src="./img/coin2.png" alt="coin2" style="min-width: 0;">
</div>
</div>
</div>
</div>
<!-- Row for displaying bets -->
<div class="row mt-5 pb-5 mb-5 gx-0">
<div class="col-12 col-sm-5 bg-primary mt-5">
<div class="container pt-3 pb-3 ps-3 pe-3">
<div class="row gx-0 border-bottom border-white border-2 pb-4">
<div class="col-4">
<img class="mx-auto d-block w-50" src="./img/coin1.png" alt="heads">
</div>
<div class="col-2"></div>
<div class="col-6 align-self-center">
<div class="text-white" style="font-size: xx-large;"> Win 1.9x</div>
</div>
</div>
<div class="row gx-0">
<div class="col-12 mt-3">
<div class="d-flex justify-content-between">
<div class="d-block">
<span class="text-white">Total bets</span>
</div>
<div class="d-block">
<div class="text-white" style="font-size: larger;"><span class="fw-bold">0 TC</span></div>
</div>
</div>
</div>
</div>
<div class="row gx-0 bg-secondary mt-3">
<div class="col-8 text-left text-white ps-3">User</div>
<div class="col-4 text-center text-white">Bet</div>
</div>
<div class="row gx-0 pt-2 pb-2 ">
<div class="col-8 text-left text-white ps-3">Elon Musk</div>
<div class="col-4 text-center text-white">270 TC</div>
</div>
<div class="row gx-0 pt-2 pb-2 ">
<div class="col-8 text-left text-white ps-3">Tony Ramos</div>
<div class="col-4 text-center text-white">135 TC</div>
</div>
</div>
</div>
<div class="col-sm-2"></div>
<div class="col-12 col-sm-5 bg-primary bg-opacity-50 mt-5">
<div class="container pt-3 pb-3 ps-3 pe-3">
<div class="row gx-0 border-bottom border-white border-2 pb-4">
<div class="col-4">
<img class="mx-auto d-block w-50" src="./img/coin2.png" alt="heads">
</div>
<div class="col-2"></div>
<div class="col-6 align-self-center">
<div class="text-white" style="font-size: xx-large;"> Win 1.9x</div>
</div>
</div>
<div class="row gx-0">
<div class="col-12 mt-3">
<div class="d-flex justify-content-between">
<div class="d-block">
<span class="text-white">Total bets</span>
</div>
<div class="d-block">
<div class="text-white" style="font-size: larger;"><span class="fw-bold">0 TC</span></div>
</div>
</div>
</div>
</div>
<div class="row gx-0 bg-secondary mt-3">
<div class="col-8 text-left text-white ps-3">User</div>
<div class="col-4 text-center text-white">Bet</div>
</div>
<div class="row gx-0 pt-2 pb-2 ">
<div class="col-8 text-left text-white ps-3">Elon Musk</div>
<div class="col-4 text-center text-white">270 TC</div>
</div>
<div class="row gx-0 pt-2 pb-2 ">
<div class="col-8 text-left text-white ps-3">Tony Ramos</div>
<div class="col-4 text-center text-white">135 TC</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Container Main end-->
<a class="position-fixed bottom-5 end-5 float-icon-chat" id="chatButton" role="button">
<span class="position-absolute top-15 start-20"><i class="far fa-comment-dots" style="font-size: 40px;"></i></span>
</a>
<div class="pre-footer mt-5 pt-5 mb-5 pb-5"></div>
<footer class="text-center text-lg-start bg-primary text-muted pt-5 mt-5 w-100">
<div class="container text-center text-md-start mt-5">
<div class="row mt-3">
<div class="col-6 mx-auto mt-5 mb-5">
<div class="d-block justify-content-center">
<div class="d-flex justify-content-center">
<img class="w-40 h-auto center-block" src="./img/Logo horizontal.png" alt="Vegaz logo">
</div>
<div class="d-flex justify-content-center mt-3">
<i class="fab fa-instagram fa-4x me-3"></i>
<i class="fab fa-facebook fa-4x"></i>
</div>
</div>
</div>
<div class="col-1"></div>
<div class="col-5 mx-auto mt-4 mb-4 position-relative">
<div class="d-flex">
<h3 class="text-white fw-bold">About Us</h3>
</div>
<div class="d-flex">
Terms of service
</div>
<div class="d-flex">
Privacy policy
</div>
<div class="d-flex position-absolute bottom-0 start-2">
<span>©2022 Vegaz All rights reserved</span>
</div>
</div>
</div>
</div>
</footer>
You're assigning the main containers a fixed height based on the viewport size (classes height-100 and h-100), even when the viewport is smaller than the content of those containers. The content will therefore overflow the container into whatever comes after it, in this case the footer.
Related
When you hover over the image, the place where it should go down from top to bottom does not work and the image does not grow when I hover over it.
Here I want the place labeled "downmen" to go down with a top-down effect. At the same time I want the picture I hover over to grow a little.
As a result, when both hover over the image, I want one to go down from the top and the other to make the image grow.
Note I used bootstrap 5 while doing these.
.section-two-card-inner-two {
position: relative;
}
.section-two-card-inner-two .downmen {
display: none;
position: absolute;
z-index: 1;
width: 100%;
height: 110px;
padding: 2% 10%;
}
.section-two-card-inner-two:hover .downmen {
display: block;
}
.section-two-card-inner-two .downmen img {
height: 55px;
}
.card-title-head {
padding-top: 100px;
}
.section-two-card-inner-two a {
padding-top: 15%;
}
.section-two-card .card-title {
font-weight: 600;
font-family: 'Manrope', sans-serif;
font-size: 1.3rem;
line-height: 26px;
}
.section-two-card .card-text {
font-weight: 700;
font-family: 'League Spartan', sans-serif;
font-size: 26px;
line-height: 30px;
}
.section-two-card .card-text:hover {
color: #ccc;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/css/bootstrap-grid.min.css" />
<div class="row row-cols-1 row-cols-lg-2 section-two-card m-0">
<div class="col p-2 section-two-card-inner ">
<div class="card bg-dark text-white section-two-card-inner-two ">
<div class="downmen d-flex text-secondary align-items-center ">
<img src="https://picsum.photos/seed/picsum/55" alt=".." class="img-fluid rounded-circle me-3">
<div class="col-10">
<h4 class="fw-normal">Posted by <strong>admin</strong></h4>
<h4 class="fw-normal">August 27, 2025</h4>
</div>
</div>
<img src="https://picsum.photos/500" alt="" class="rounded-4 border-0 img-fluid">
<div class="card-img-overlay p-4 p-sm-5 border border-0 ">
<div class="d-flex card-title-head">
<h5 class="card-title text-secondary">Most Read </h5>
<h4 class="card-title ms-3"><i class="bi bi-clock fs-5 text-white me-2"></i> 6 min read</h4>
</div>
<p class="card-text">This will help you become the first and strengthen your position</p>
Read More <i class="bi bi-arrow-right ms-2 fs-4"></i>
</div>
</div>
</div>
</div>
Your example provides everything you need. Just use your browser to inspect the initial state of the relevant elements (.card_post) and that after forcing hover on .item-wrapper.
The only lingering issue is that the hover state is triggered on an element which is larger than the image. That could be refined with layout adjustments.
.section-two-card-inner-two {
position: relative;
overflow: hidden; /* new */
}
.section-two-card-inner-two img {
transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.4s; /* new */
}
.section-two-card-inner-two:hover img {
transform: scale(1.1); /* new */
}
.section-two-card-inner-two .downmen {
opacity: 0; /* new */
transform: translateY(-10px); /* new */
transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.4s; /* new */
position: absolute;
z-index: 1;
width: 100%;
height: 110px;
padding: 2% 10%;
}
.section-two-card-inner-two:hover .downmen {
opacity: 1; /* new */
transform: translateY(0); /* new */
}
.section-two-card-inner-two .downmen img {
height: 55px;
}
.card-title-head {
padding-top: 100px;
}
.section-two-card-inner-two a {
padding-top: 15%;
}
.section-two-card .card-title {
font-weight: 600;
font-family: 'Manrope', sans-serif;
font-size: 1.3rem;
line-height: 26px;
}
.section-two-card .card-text {
font-weight: 700;
font-family: 'League Spartan', sans-serif;
font-size: 26px;
line-height: 30px;
}
.section-two-card .card-text:hover {
color: #ccc;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/css/bootstrap-grid.min.css" />
<div class="row row-cols-1 row-cols-lg-2 section-two-card m-0">
<div class="col p-2 section-two-card-inner ">
<div class="card bg-dark text-white section-two-card-inner-two ">
<div class="downmen d-flex text-secondary align-items-center ">
<img src="https://picsum.photos/seed/picsum/55" alt=".." class="img-fluid rounded-circle me-3">
<div class="col-10">
<h4 class="fw-normal">Posted by <strong>admin</strong></h4>
<h4 class="fw-normal">August 27, 2025</h4>
</div>
</div>
<img src="https://picsum.photos/500" alt="" class="rounded-4 border-0 img-fluid">
<div class="card-img-overlay p-4 p-sm-5 border border-0 ">
<div class="d-flex card-title-head">
<h5 class="card-title text-secondary">Most Read </h5>
<h4 class="card-title ms-3"><i class="bi bi-clock fs-5 text-white me-2"></i> 6 min read</h4>
</div>
<p class="card-text">This will help you become the first and strengthen your position</p>
Read More <i class="bi bi-arrow-right ms-2 fs-4"></i>
</div>
</div>
</div>
</div>
I try adding removing max width for the grid will be used but it's not satisfying to see when the whole card get the width of the site
This is the home page when not searching
Then this is the image when two cards appear in the search
.card-grid, .food-list{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
align-items: flex-start;
padding-top: 1rem;
}
.card {
--padding: 1rem;
background: #e8eef1;
border: 1px solid #777;
border-radius: .25rem;
overflow: hidden;
margin-left: 10px;
margin-right: 10px;
margin-bottom: 10px;
}
.card.card-shadow {
border: none;
box-shadow: 0 4px 21px -12px rgba(0, 0, 0, .79);
max-width: 700px;
}
.card-header {
font-size: 1.5rem;
padding: var(--padding);
padding-bottom: 0;
margin-bottom: .5rem;
}
.card-header.card-image {
padding: 0;
overflow: hidden;
}
.card-header.card-image > img {
display: block;
width: 100%;
max-height: 200px;
aspect-ratio: 16 / 9;
object-fit: cover;
object-position: center;
transition: 200ms transform ease-in-out;
}
.card:hover > .card-header.card-image > img {
transform: scale(1.025);
}
.card-body {
font-size: .9rem;
text-align: center;
padding: 0 var(--padding);
}
.card-footer {
margin-top: 1rem;
padding: var(--padding);
padding-top: 0;
text-align: center;
}
<div class="card-grid" >
<div class="food-list" id="food-list">
<div class="card card-shadow">
<div class="card-header card-image">
<img src="/img/Sisig.webp">
</div>
<div class="card-body" >
<h3> Sisig </h3>
</div>
<div class="card-footer">
<button class="btn">Get Recipe</button>
</div>
</div>
<div class="card card-shadow">
<div class="card-header card-image">
<img src="/img/Adobo.webp">
</div>
<div class="card-body" >
<h3> Adobo </h3>
</div>
<div class="card-footer">
<button class="btn">Get Recipe</button>
</div>
</div>
<div class="card card-shadow">
<div class="card-header card-image">
<img src="/img/Porkchop.webp">
</div>
<div class="card-body" >
<h3>Porkchop with Gravy</h3>
</div>
<div class="card-footer">
<button class="btn">Get Recipe</button>
</div>
</div>
<div class="card card-shadow">
<div class="card-header card-image">
<img src="/img/Omelette.webp">
</div>
<div class="card-body" >
<h3>Omelette</h3>
</div>
<div class="card-footer">
<button class="btn">Get Recipe</button>
</div>
</div>
<div class="card card-shadow">
<div class="card-header card-image">
<img src="/img/Sinigang.webp">
</div>
<div class="card-body" >
<h3> Sinigang </h3>
</div>
<div class="card-footer">
<button class="btn">Get Recipe</button>
</div>
</div>
<div class="card card-shadow">
<div class="card-header card-image">
<img src="/img/Lumpia.webp">
</div>
<div class="card-body" >
<h3> Lumpia</h3>
</div>
<div class="card-footer">
<button class="btn">Get Recipe</button>
</div>
</div>
</div>
</div>
i already try flex but the responsive of the site didn't go well it become vertical cards of options
This question already has answers here:
Semi-transparent color layer over background-image?
(19 answers)
Closed last year.
I'm build a page that nedds a background image with a semi transparent black cover on top (rgba 0 0 0 0.5).
My initial solution was to do:
<body id="body-pd" style="background: url('./img/Home e Roleta.png') no-repeat center center fixed; background-size: cover; box-shadow: inset 0 0 0 1000px rgba(0,0,0,.5);">
And I though it had worked. But now that I'm developing some larger pages in the site, it appears that when I scroll down the semi transparent cover doesn't follow along:
I tried to find a solution online, but couldn't find any topics on the matter.
Does anyone have an idea of how it can be solved?
Full code (uses bootstrap5):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link href="./css/custom.css" rel="stylesheet">
<link href="./css/navlayout.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/boxicons#latest/css/boxicons.min.css" rel="stylesheet">
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script defer src="./js/navlayout.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js" crossorigin="anonymous"></script>
<script defer src="./js/crash.js"></script>
<link rel="icon" href="./img/icon.png" />
<title>Vegaz.bet</title>
</head>
<body id="body-pd" style="background: url('./img/Home e Roleta.png') no-repeat center center fixed; background-size: cover; box-shadow: inset 0 0 0 1000px rgba(0,0,0,.5);">
<header class="top-header align-middle">
<div class="mx-auto"></div>
</header>
<header class="header" id="header">
<div class="d-flex">
<div class="header_toggle me-3" id="toggle-up"> <i class="fas fa-bars secondary-bs-color" id="header-toggle"></i></div>
<img style="width: 50px;" class="h-auto me-1 d-none d-sm-flex" src="./img/Logo Vegaz Bet MOEDA.png" alt="">
<img style="width: 120px;" class="h-auto d-flex" src="./img/Logo Vegaz Bet ESCRITA.png" alt="">
</div>
<div id="nav-buttons" class="d-flex">
<button type="button" class="white-bs-color fw-bold btn btn-primary me-4" data-bs-toggle="modal" data-bs-target="#login-modal">Login</button>
<button type="button" class="white-bs-color fw-bold btn btn-secondary" data-bs-toggle="modal" data-bs-target="#registration-modal">Register</button>
</div>
</header>
<div class="l-navbar" id="nav-bar">
<nav class="nav">
<div>
<div class="nav_list">
<i class="fas fa-chart-line nav_icon secondary-bs-color"></i> <span class="nav_name">Crash</span>
<i class="far fa-life-ring nav_icon secondary-bs-color"></i> <span class="nav_name">Roullete</span>
<i class="fas fa-dice nav_icon secondary-bs-color"></i> <span class="nav_name">Dice</span>
<i class="fas fa-coins nav_icon secondary-bs-color"></i> <span class="nav_name">Heads or Tails</span>
<hr class="bg-white border-2 border-top border-white">
<i class="fas fa-hand-holding-usd nav_icon white-bs-color"></i> <span class="nav_name">Deposit /<br> Withdrawal</span>
<i class="far fa-question-circle nav_icon white-bs-color"></i> <span class="nav_name">Help</span>
</div>
</div>
</nav>
</div>
<div class="r-navbar invisible" id="nav-bar-chat">
<div id="invisible-toggle-div" class="container pb-5 invisible">
<div class="row h-20 mb-1">
<button id="close-chat" type="button" class="position-absolute top-8 start-10 btn-close btn-close-white" aria-label="Close"></button>
<button type="button" class="w-50 position-absolute top-7 end-10 white-bs-color fw-bold btn btn-primary"><span class="text-nowrap">Vegaz Chat</span></button>
</div>
<div class="row h-60">
<div id="chatContainer" class="chat-font d-flex flex-column bd-highlight position-absolute top-15 end-5 w-90 h-75">
<span class="time-span-chat ms-2">11:29</span>
<div class="card bg-field-grey text-white mb-1">
<span class="pt-1 pb-1 ps-1 pe-1"><span class="fw-bold" style="color: yellow">youranus420:</span> oi putões</span>
</div>
<span class="time-span-chat ms-2">11:29</span>
<div class="card bg-field-grey text-white mb-1">
<span class="pt-1 pb-1 ps-1 pe-1"><span class="fw-bold" style="color: yellow">youranus420:</span> bora crash?</span>
</div>
<span class="time-span-chat ms-2">11:30</span>
<div class="card bg-field-grey text-white mb-1">
<span class="pt-1 pb-1 ps-1 pe-1"><span class="fw-bold" style="color: purple">elon musk:</span> Olha o nome do cara kkkkk</span>
</div>
</div>
</div>
<div class="row h-10">
<div class="bg-primary text-center position-absolute end-3 bottom-6 w-94 h-5">
<div class="input-group mb-3">
<input type="text" class="chat-font form-control" placeholder="Your message" aria-label="Message">
<button class="chat-font btn btn-outline-secondary" type="button" id="button-addon2">Send</button>
</div>
</div>
</div>
</div>
</div>
<!--Container Main start-->
<div class="height-100 main-container-page">
<div class="container h-100">
<img style="display: none;" src="./img/foguete.png" alt="foguete" id="img-rocket" />
<img style="display: none;" src="./img/explosion.png" alt="explosion" id="img-explosion" />
<div class="row h-50 gx-0">
<div class="col-12 col-sm-5 order-sm-1 order-2 bg-opacity-white bg-opacity-25 text-center game-top pt-4 ps-5 pe-5">
<div class="card bg-field-grey text-white mb-3">
<div class="d-flex justify-content-between">
<button type="button" class="white-bs-color fw-bold opacity-50 btn btn-primary w-46">Normal</button>
<button type="button" class="white-bs-color fw-bold btn btn-primary w-46">Auto</button>
</div>
</div>
<div class="card bg-field-grey text-white mb-3">
<span class="pt-1 pb-1 ps-1 pe-1"><span class="fw-bold" style="color: yellow">youranus420:</span> oi putões</span>
</div>
</div>
<div class="col-12 col-sm-7 order-sm-2 order-1 bg-opacity-white bg-opacity-25 text-center game-col">
<div class="d-flex h-80 game-block pt-4 ps-4 pe-4">
<canvas class="crash-canvas" id="canvas" height="400px" width="700px"></canvas>
</div>
<div class="d-block h-35 game-top ps-3 pt-3">
<div class="d-flex text-white fw-bold ms-1 mb-3">
Last runs:
</div>
<div class="d-flex justify-content-start">
<span class="badge bg-primary ms-1 me-1">2.37x</span>
<span class="badge bg-primary ms-1 me-1">2.37x</span>
<span class="badge bg-primary ms-1 me-1">2.37x</span>
<span class="badge bg-primary ms-1 me-1">2.37x</span>
<span class="badge bg-primary ms-1 me-1">2.37x</span>
</div>
</div>
</div>
</div>
</div>
</div>
<a class="position-absolute bottom-5 end-5 float-icon-chat" id="chatButton" role="button">
<span class="position-absolute top-15 start-20"><i class="far fa-comment-dots" style="font-size: 40px;"></i></span>
</a>
<!--Container Main end-->
</body>
</html>
CSS:
#import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");
:root {
--top-header-top-position: 1.5rem;
--header-height: 3rem;
--nav-width: 68px;
--chat-width: 100px;
--primary-color: var(--bs-primary);
--secondary-color: var(--bs-secondary);
--field-gray: var(--bs-field-grey);
--field-grey-transparency: var(--bs-field-grey-transparency);
--white-color: var(--bs-white);
--body-font: 'Montserrat', sans-serif;
--normal-font-size: 1rem;
--z-fixed: 100;
--z-topbar: 101;
}
*,
::before,
::after {
box-sizing: border-box
}
.top-header {
width: 100%;
height: var(--top-header-top-position);
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
background-color: var(--secondary-color);
z-index: var(--z-topbar);
transition: .5s;
text-align: center !important;
}
.header {
width: 100%;
height: var(--header-height);
position: fixed;
top: var(--top-header-top-position);
left: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
background-color: var(--primary-color);
z-index: var(--z-fixed);
transition: .5s
}
.main-container-page {
padding-top: calc(var(--header-height) + var(--top-header-top-position) + 5rem);
z-index: 5000;
}
.header_toggle {
color: var(--primary-color);
font-size: 1.5rem;
cursor: pointer
}
.header_img {
width: 35px;
height: 35px;
display: flex;
justify-content: center;
border-radius: 50%;
overflow: hidden
}
.header_img img {
width: 40px
}
.l-navbar {
position: fixed;
top: 0;
left: -30%;
width: var(--nav-width);
height: 100vh;
background-color: var(--primary-color);
padding: .5rem 1rem 0 0;
transition: .5s;
z-index: var(--z-fixed)
}
.r-navbar {
position: fixed;
top: 0;
right: 0;
width: 0;
height: 100vh;
background-color: var(--primary-color);
padding: 1rem 0 0 1rem;
transition: .5s;
z-index: var(--z-fixed);
padding: 1rem 0 0 1rem;
}
.nav {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
margin-top: 5rem;
}
.nav_logo,
.nav_link {
display: grid;
grid-template-columns: max-content max-content;
align-items: center;
column-gap: 1rem;
padding: .5rem 0 .5rem 1.5rem;
text-decoration: none;
}
.nav_logo {
margin-bottom: 2rem
}
.nav_logo-icon {
font-size: 1.25rem;
color: var(--white-color)
}
.nav_logo-name {
color: var(--white-color);
font-weight: 700
}
.nav_link {
position: relative;
color: var(--white-color);
margin-bottom: 1.5rem;
transition: .3s
}
.nav_link:hover {
color: var(--white-color)
}
.nav_icon {
font-size: 1.25rem;
}
.secondary-bs-color {
color: var(--bs-secondary)
}
.white-bs-color {
color: var(--white-color)
}
.show-left-nav {
left: 0;
width: calc(var(--nav-width) + 156px);
}
.show-right-nav {
width: 100%;
}
.body-menu-pd {
padding-left: calc(var(--nav-width) + 188px);
}
.body-chat-pd {
padding-right: calc(var(--chat-width) + 1rem);
}
.chat-font {
font-size: small;
}
.time-span-chat {
font-size: smaller;
color: var(--white-color);
}
#chatContainer {
-ms-overflow-style: none; /* for Internet Explorer, Edge */
scrollbar-width: none; /* for Firefox */
overflow-y: scroll;
}
#chatContainer::-webkit-scrollbar {
display: none; /* for Chrome, Safari, and Opera */
}
.active {
color: var(--white-color)
}
.active::before {
content: '';
position: absolute;
left: 0;
width: 2px;
height: 32px;
background-color: var(--white-color)
}
.height-100 {
height: 100vh
}
.float-icon-chat {
width: 60px;
height: 60px;
bottom: 40px;
right: 40px;
background-color: var(--secondary-color);
color: var(--white-color);
border-radius: 50px;
text-align: center;
vertical-align: middle;
z-index: 100;
}
.coin-dropdown-item {
color: var(--white-color);
}
.coin-dropdown-item:hover {
color: var(--secondary-color);
background-color: var(--field-grey-transparency);
font-weight: bold;
}
#media screen and (min-width: 768px) {
.header {
height: calc(var(--header-height) + 1rem);
padding: 0 2rem 0 calc(var(--nav-width) + 2rem)
}
.header_img {
width: 40px;
height: 40px
}
.header_img img {
width: 45px
}
.l-navbar {
left: 0;
padding: 1rem 1rem 0 0
}
.r-navbar {
right: 0;
padding: 1rem 0 0 1rem;
width: 0;
}
.show-left-nav {
width: calc(var(--nav-width) + 156px)
}
.show-right-nav {
width: calc(var(--chat-width) + 156px)
}
.body-menu-pd {
padding-left: calc(var(--nav-width) + 188px);
}
.body-chat-pd {
padding-right: calc(var(--chat-width) + 156px)
}
}
/* Media queries for conditional borders on games */
.game-col {
border-left: none;
}
.game-block {
border-bottom: none;
}
.game-top {
border-top: 1px solid var(--white-color);
}
#media (min-width: 576px) {
.game-col {
border-left: 1px solid var(--white-color);
}
.game-block {
border-bottom: 1px solid var(--white-color);
}
.game-top {
border-top: none;
}
}
/* crash game */
.crash-canvas {
width: 100%;
max-width: 750px;
border-radius: 7px;
background-color: #0f1923;
margin: 0rem auto 2rem auto;
}
Why do you don't use the CSS filter property on your background image? you can use filter: brightness(0.5); or filter: opacity(0.5); on your image to make it semi-transparent black.
more of CSS filter property: https://developer.mozilla.org/en-US/docs/Web/CSS/filter
Why not use linear-gradient with background-image like so
background-image: linear-gradient(rgba( 0, 0, 0, 0.5), rgba( 0, 0, 0, 0.5)), url("./img/Home e Roleta.png");
Since both color are same(rgba( 0, 0, 0, 0.5)) shades will be constant and will be part of the background-image.
I have written some CSS and used bootstrap to create a horizontal div with scroll ability but the output is not proper if I add
<meta name="viewport" content="width=device-width, initial-scale=1">
In My Code
Code Output
My Code:
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<style>
::-webkit-scrollbar {
width: 1px;
height: 0px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
.scrolling-wrapper{
overflow-x: auto;
}
.card-block{
height: 200px;
width: 163px;
background-color: #141414;
border: none;
background-position: center;
background-size: cover;
transition: all 0.2s ease-in-out !important;
border-radius: 8px;
}
.card-block img{
display: block;
border-radius: 50%;
height: 82px;
width: 82px;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
}
.card-block span{
display: block;
font-size: 18px;
color: #fff;
margin-top: 4px;
margin-left: auto;
margin-right: auto;
}
.card-block a{
background-color: #007bdc;
padding-left: 4px;
padding-right: 4px;
padding-top: 2px;
padding-bottom: 2px;
margin-right: auto;
margin-left: auto;
text-decoration: none;
color: #fff;
font-size: 12px;
border-radius: 4px;
margin-top: 12px;
}
</style>
<div class="scrolling-wrapper row flex-row flex-nowrap mt-6 pb-6 pt-3">
<div class="col-2">
<div class="card card-block card-1">
<img src="http://placehold.it/80x80">
<span>
Om Prakash
</span>
<a href="#">
More Info
</a>
</div>
</div>
<div class="col-2">
<div class="card card-block card-2">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-3">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-4">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-5">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-6">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-7">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-8">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-9">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-2">
<div class="card card-block card-10">
<img src="http://placehold.it/80x80">
</div>
</div>
</div>
<br/>
<br/>
<br/>
try using col-auto instead of col-2 and mx-0 with row
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<style>
::-webkit-scrollbar {
width: 1px;
height: 0px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
.scrolling-wrapper{
overflow-x: auto;
}
.card-block{
height: 200px;
width: 163px;
background-color: #141414;
border: none;
background-position: center;
background-size: cover;
transition: all 0.2s ease-in-out !important;
border-radius: 8px;
}
.card-block img{
display: block;
border-radius: 50%;
height: 82px;
width: 82px;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
}
.card-block span{
display: block;
font-size: 18px;
color: #fff;
margin-top: 4px;
margin-left: auto;
margin-right: auto;
}
.card-block a{
background-color: #007bdc;
padding-left: 4px;
padding-right: 4px;
padding-top: 2px;
padding-bottom: 2px;
margin-right: auto;
margin-left: auto;
text-decoration: none;
color: #fff;
font-size: 12px;
border-radius: 4px;
margin-top: 12px;
}
</style>
<div class="scrolling-wrapper row mx-0 flex-nowrap mt-6 pt-3">
<div class="col-auto">
<div class="card card-block card-1">
<img src="http://placehold.it/80x80">
<span>
Om Prakash
</span>
<a href="#">
More Info
</a>
</div>
</div>
<div class="col-auto">
<div class="card card-block card-2">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-3">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-4">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-5">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-6">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-7">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-8">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-9">
<img src="http://placehold.it/80x80">
</div>
</div>
<div class="col-auto">
<div class="card card-block card-10">
<img src="http://placehold.it/80x80">
</div>
</div>
</div>
<br/>
<div> <p>Hello I'm a Text</p></div>
<br/>
<br/>
#import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght#0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
#font-face {
font-family: Pangolin;
src: url("../Fonts/Pangolin.ttf");
}
* {
font-family: Pangolin, serif;
box-sizing: border-box;
}
html, body, header{
height:100%;
margin:0;
}
.container-inner{
min-height: 100%;
padding:0;
}
#carouselExampleIndicators, .carousel-inner, .carousel-item{
height: 100%;
}
.carousel-inner{
overflow: visible;
}
.main-container-in-slider {
color: #fff;
position: relative;
z-index: 2;
text-transform: uppercase;
}
.main-container-in-slider h1 {
font-size: 3em;
font-weight: bold;
font-family: 'Pangolin', cursive;
text-shadow: 2px 4px 10px #333;
}
#media only screen and (min-width: 768px) {
.main-container-in-slider h1 {
font-size: 4em;
}
}
.carousel-item .background {
height:100%;
background: no-repeat center center scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
filter: blur(6px);
}
.carousel-indicators li:hover {
background-color: #6e43bf;
-webkit-transition: background-color 300ms linear;
transition: background-color 300ms linear;
}
.carousel-indicators li {
text-indent: initial;
border-radius: 30px;
background-color: black;
opacity: 1;
padding: 10px 20px;
box-shadow: none;
border-width: 0px;
border-style: solid;
border-color: RGBA(0, 0, 0, 1);
margin: 5px;
color: #ffffff;
font-size: 0.9em;
text-shadow: none;
line-height: 1.2;
font-style: normal;
text-decoration: none;
text-align: center;
letter-spacing: 1px;
word-spacing: normal;
text-transform: uppercase;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
width: auto;
height: auto;
}
.carousel-control-prev, .carousel-control-next {
z-index: 2;
width: auto;
margin-left: 10px;
margin-right: 10px;
}
.carousel-control-prev-icon, .carousel-control-next-icon {
width: 40px;
height: 40px;
}
#first-carousel {
min-height: auto;
}
.data-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
z-index: 2;
height: 100%;
width: 95%;
}
.right {
width: 100%;
}
#custom-controls-carousel {
position: absolute;
bottom: 40px;
z-index: 2;
}
.video-container {
max-width: 1200px;
}
video {
width: 100%;
border-radius: 14px;
}
.slider-caption {
padding-left: 15px;
font-size: 2.5em;
text-transform: uppercase;
}
.slider-text {
max-width: 600px;
font-size: 1.2em;
color: RGBA(255, 255, 255, 0.69);
letter-spacing: 0.05em;
}
.fas {
color: white;
}
.fas:hover {
color: #eae7f7;
}
.overlay {
background-color: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
position: absolute;
top: 0;
z-index: 1;
}
.cst-line {
width: 100px;
height: 5px;
background-color: #ffca25;
}
#media only screen and (min-width: 1200px) {
.right {
width: 50%;
max-width: 1200px;
min-width: 700px;
}
#custom-controls-carousel {
bottom: 50px;
}
video {
min-width: 700px;
}
.slider-caption {
border-left: 5px solid #ffca25;
}
}
.border-blue {
border-left-color: #58aaff;
}
.border-green {
border-left-color: #41ffa6;
}
.border-orange {
border-left-color: #ff5a4b;
}
.border-purple {
border-left-color: #8747ff;
}
.line-blue {
background: #58aaff;
}
.line-green {
background: #41ffa6;
}
.line-orange {
background: #ff5a4b;
}
.line-purple {
background: #8747ff;
}
.btn {
position: relative;
z-index: 2;
color: #ffffff;
padding: 10px 30px;
font-size: 1.2em;
border-radius: 99px;
font-weight: bold;
text-shadow: 1px 1px 5px #333;
letter-spacing: 0.1em;
}
.btn-blue {
background: #58aaff;
border: 4px solid #5887ff;
}
.btn-green {
background: #41ffa6;
border: 4px solid #43ff96;
}
.btn-orange {
background: #ff5a4b;
border: 4px solid #ff2c37;
}
.btn-purple {
background: #8747ff;
border: 4px solid #8b50ff;
}
.btn-blue:hover {
color: #58aaff;
background-color: black;
}
.btn-green:hover {
color: #41ffa6;
background-color: black;
}
.btn-orange:hover {
color: #ffca25;
background-color: black;
}
.btn-purple:hover {
color: #8747ff;
background-color: black;
}
.fa-play-circle {
top:50%;
left:50%;
transform: translate(-50%, -50%);
z-index: 2;
}
.fa-play-circle:hover {
color: #e2e4ef;
cursor: pointer;
}
#media only screen and (max-height: 1000px) {
.data-container{
justify-content: start!important;
}
}
.carousel{
overflow: scroll;
}
<!DOCTYPE html>
<html lang="sk">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://kit.fontawesome.com/18e42a7034.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>SPŠIT | DOD</title>
</head>
<body>
<header>
<div id="carouselExampleIndicators" class="carousel slide" data-interval="false">
<ol class="carousel-indicators d-flex ">
<li data-target="#carouselExampleIndicators" data-slide-to="0">
<span class="d-none d-md-block">
Informačné technológie
</span>
<i class="fas fa-server fa-2x d-md-none"></i>
</li>
<li data-target="#carouselExampleIndicators" data-slide-to="1">
<span class="d-none d-md-block">
Elektrotechnika
</span>
<i class="fas fa-car-battery fa-2x d-md-none"></i>
</li>
<li data-target="#carouselExampleIndicators" data-slide-to="2">
<span class="d-none d-md-block">
Informačné a SieŤové technológie
</span>
<i class="fas fa-laptop fa-2x d-md-none"></i>
</li>
<li data-target="#carouselExampleIndicators" data-slide-to="3">
<span class="d-none d-md-block">
Strojárstvo
</span>
<i class="fas fa-wrench fa-2x d-md-none"></i>
</li>
</ol>
<div class="carousel-inner" role="listbox">
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item active">
<div class="background"
style="background-image: url('https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fblog.biamp.com%2Fwp-content%2Fuploads%2F2017%2F02%2Fvm_videocodecs_00-1024x681.jpg&f=1&nofb=1')">
</div>
<div class="data-container d-flex flex-column justify-content-center flex-xl-row align-items-center mt-3 mt-lg-2 p-2 p-md-4 p-lg-5">
<div class="left mr-0 mr-lg-4 mt-2 mt-xl-0 order-2 order-xl-1">
<h2 class="slider-caption border-orange text-center text-xl-left ">Informačné technológie</h2>
<div class="cst-line d-xl-none mx-auto line-orange"></div>
<p class="slider-text text-center text-xl-left p-x pt-2 p-xl-0">
Absolvent študijného odboru inteligentné technológie je kvalifikovaný odborný pracovník,
ktorý má vedomosti a zručnosti z oblasti informačných technológií, programovania,
počítačových sietí, smart technológií, internetu vecí, databázových systémov, základov
kybernetickej bezpečnosti, robotiky, 3D technológií, serverových a cloudových technológií,
grafiky, základov elektroniky, optimalizácie riadenia procesov a problematiky súvisiacej s
digitálnou firmou. Je schopný využívať mäkké zručnosti v prezentovaní a vystupovaní.
</p>
<div class="text-center text-xl-left">
<a href="http://www.spsknm.sk/ssknm/sk/inteligentne-technologie" target="_blank"
class="btn btn-orange">
<i class="fas fa-hand-point-right"></i>
Zistiť viac
</a>
</div>
</div>
<div class="right order-1 order-xl-2">
<div class="video-container position-relative">
<i class="fas fa-play-circle fa-4x position-absolute"></i>
<video>
<source src="videos/video1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</div>
</div>
</div>
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item">
<div class="background"
style="background-image: url('assets/slider-electro.jpg')">
</div>
<div class="data-container d-flex flex-column justify-content-center flex-xl-row align-items-center mt-3 mt-lg-2 p-2 p-md-4 p-lg-5">
<div class="left mr-0 mr-lg-4 mt-2 mt-xl-0 order-2 order-xl-1">
<h2 class="slider-caption border-green text-center text-xl-left ">Elektrotechnika</h2>
<div class="cst-line d-xl-none mx-auto line-green"></div>
<p class="slider-text text-center text-xl-left p-x pt-2 p-xl-0">
Absolventi študijného odboru sú podľa zamerania pripravení na vykonávanie prác v oblasti
konštrukcie, výroby a prevádzky slaboprúdových zariadení, obsluhy, montáže, základnej údržby
výpočtovej techniky a počítačových sietí. V oblasti konštrukcie sú pripravení pracovať s
grafickým programovým systémom OrCAD 16, LaB VIEW, programujú v jazyku C. Navrhujú a
programujú riadiace systémy na báze jednočipových mikrokontrolérov rady AVR a PLC, vytvárajú
www stránky a iné internetové aplikácie. Absolventi budú vedieť využívať databázové systémy
a komunikovať v jednom svetovom jazyku.
</p>
<div class="text-center text-xl-left">
<a href="http://www.spsknm.sk/ssknm/sk/elektrotechnika" target="_blank"
class="btn btn-green">
<i class="fas fa-hand-point-right"></i>
Zistiť viac
</a>
</div>
</div>
<div class="right order-1 order-xl-2">
<div class="video-container position-relative">
<i class="fas fa-play-circle fa-4x position-absolute"></i>
<video>
<source src="videos/video1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</div>
</div>
</div>
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item">
<div class="background"
style="background-image: url('assets/slider-ist2.jpg')">
</div>
<div class="data-container d-flex flex-column justify-content-center flex-xl-row align-items-center mt-3 mt-lg-2 p-2 p-md-4 p-lg-5">
<div class="left mr-0 mr-lg-4 mt-2 mt-xl-0 order-2 order-xl-1">
<h2 class="slider-caption border-blue text-center text-xl-left ">INFORMAČNÉ A SIEŤOVÉ
TECHNOLÓGIE</h2>
<div class="cst-line d-xl-none mx-auto line-blue"></div>
<p class="slider-text text-center text-xl-left p-x pt-2 p-xl-0">
Absolvent študijného odboru Informačné a sieťové technológie je kvalifikovaný zamestnanec
schopný samostatne vykonávať práce pri projektovaní, konštrukcii, výrobe, montáži, ako aj v
prevádzke a údržbe zariadení využívajúce moderné IT.
Pre kvalifikované vykonávanie uvedených činností získava absolvent štúdiom široký odborný
profil s nevyhnutným všeobecným vzdelaním, s dostatočnou adaptabilitou, logickým myslením a
schopnosťou aplikovať nadobudnuté vedomosti pri riešení problémov samostatne aj v tíme.
</p>
<div class="text-center text-xl-left">
<a href="http://www.spsknm.sk/ssknm/sk/informacne-a-sietove-technologie" target="_blank"
class="btn btn-blue">
<i class="fas fa-hand-point-right"></i>
Zistiť viac
</a>
</div>
</div>
<div class="right order-1 order-xl-2">
<div class="video-container position-relative">
<i class="fas fa-play-circle fa-4x position-absolute"></i>
<video>
<source src="videos/video1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</div>
</div>
</div>
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item">
<div class="background"
style="background-image: url('assets/slider-engineer.jpg')">
</div>
<div class="data-container d-flex flex-column justify-content-center flex-xl-row align-items-center mt-3 mt-lg-2 p-2 p-md-4 p-lg-5">
<div class="left mr-0 mr-lg-4 mt-2 mt-xl-0 order-2 order-xl-1">
<h2 class="slider-caption border-purple text-center text-xl-left ">Strojártstvo</h2>
<div class="cst-line d-xl-none mx-auto line-purple"></div>
<p class="slider-text text-center text-xl-left p-x pt-2 p-xl-0">
Tento študijný odbor zaznamenal najväčšie zmeny, ktoré sa týkajú predovšetkým obsahu štúdia,
hlavne v posilnení zaradenia prác s výpočtovou technikou do všetkých štyroch ročníkov a
zaradenie predmetov z oblasti automobilovej konštrukcie a výroby v rámci výbornej spolupráce
s KIA Motors Slovakia. Absolventi študijného odboru sú pripravení pracovať v oblasti
konštrukcie s grafickým programovým systémom AutoCAD, Inventor a Pro/Engineer Wildfire. Sú
pripravení na vykonávanie prác v oblasti technickej prípravy, tvorby technických výkresov a
riadenia výroby pomocou počítačov, predovšetkým programovania počítačom riadených CNC
obrábacích strojov a v súvislosti s rozmachom automobilového priemyslu sa zaoberajú aj
konštrukciou automobilov. Sú pripravení na štúdium na vysokých školách hlavne technického
zamerania.
</p>
<div class="text-center text-xl-left">
<a href="http://www.spsknm.sk/ssknm/sk/strojarstvo" target="_blank" class="btn btn-purple">
<i class="fas fa-hand-point-right"></i>
Zistiť viac
</a>
</div>
</div>
<div class="right order-1 order-xl-2">
<div class="video-container position-relative">
<i class="fas fa-play-circle fa-4x position-absolute"></i>
<video source src="videos/video1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</div>
</div>
</div>
<div class="overlay"></div>
<a class="carousel-control-prev d-none d-xl-flex" href="#carouselExampleIndicators" role="button"
data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next d-none d-xl-flex" href="#carouselExampleIndicators" role="button"
data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</header>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>
my issue is this:
My content inside my Carousel which is defined at 100% height is not dynamically expanding when the content height is bigger then screen height. For example when height is 500px it is not enough for showing all my content on screen. But content is not scrollable but it is cropped like in overflow:hidden attribute. Why is this working like that and how to prevent this behaviour?
I think it is not necessary to put all my code here because it is only css and html. I have this on my own live server so I put only url here. If someone know I will be very thankful.
My link: https://younglocal.sk
here is image where you can see my content is not scrollable on low resolutions. It is getting cropped.
I can put there my css + html but as I wrote for analyze the problem it is not necessary when it is putted on live server... Thx
Since you shared only your link, I have solved it using inspect tool. Might not be accurate.
.carousel-item.active, .carousel-item-next, .carousel-item-prev{
overflow: scroll;
}