body content goes of out of container - html

I am trying to create a responsive layout and hence faced an issue. Issue is that body content exceeds the the layout on minimizing below 250px; however i know below 320px it doesn't matter if it loses responsivity still it looks unprofessional. i hope experts will help me in this regard.
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/NjMWV.png
function toggleMobileMenu(menu){
menu.classList.toggle('open');
}
function toggleSidebar(menu){
menu.classList.toggle('open');
}
html{
height: 100%;
box-sizing: border-box;
}
*,*:after,*:before{
box-sizing: inherit;
}
body{
position: relative;
min-height: 100%;
min-width: 100%;
box-sizing: border-box;
margin: 0;
padding-bottom:12rem;
font-family: 'Roboto', sans-serif !important;
background: #f2f2f2;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.body-content{
padding-bottom: 0.5rem;
width: 100%;
}
/*Main ends here*/
/*Global*/
h2{
color: #007bff;
font-size: 20px;
}
li,a{
list-style: none;
text-decoration: none;
}
.button{
padding: 9px 25px;
background-color: rgba(0, 136, 169, 1);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
color: #fff;
}
/*Global*/
header{
padding:0 20px;
background: #007991; /* fallback for old browsers */
background: -webkit-linear-gradient(to left, #78ffd6, #007991); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #78ffd6, #007991); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
-webkit-box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.75);
height: 50px;
width: 100%;
min-width: 100%;
display:flex;
justify-content:space-between;
z-index: 1001;
position: -moz-sticky;
position: -webkit-sticky;
position: sticky;
top: 0;
}
.logo{
width: 30px;
height: 30px;
justify-self: start;
margin: 10px 20px;
cursor: pointer;
}
header nav {
overflow: hidden;
margin-right: auto;
}
header nav ul{
list-style: none;
}
header nav ul li{
display: inline-block;
padding-left: 20px;
}
.active a{
color: #fff;
}
header nav ul li:hover{
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
header nav ul li a{
color: #f2f3f5;
padding: 10px;
text-decoration: none;
font-weight:400 !important;
}
header nav ul li a:hover{
color: #fff;
font-weight: 400 !important;
}
.access{
margin: 9px;
list-style: none;
display: block;
position: relative;
z-index: 100;
}
.access button{
padding: 9px 25px;
background-color: rgba(0, 136, 169, 1);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
color: #fff;
}
.access button:hover{
background: rgba(0, 136, 169, 0.8);
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
.access li{
list-style: none;
cursor: pointer;
}
.access li a{
text-decoration: none;
}
.access li ul{
background-color: rgba(0, 136, 169, 1);
display: none; /*submenu dissappears when set to none*/
text-align: center;
padding: 10px 25px;
margin-top: 8px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.access li:hover ul{
display : block;
}
.access-menu li a{
color: #fff !important;
font-weight: 400!important;
}
.access-menu.reveal{
display: block;
}
.access li ul li{
padding: 5px;
color: #fff;
display: block;
font-weight:500;
}
.access li ul li:hover{
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
/*mobile-menu*/
#hamburger-icon{
margin: auto 0;
display: none;
cursor: grab;
background: rgba(0, 136, 169, 1);
border-radius: 5px;
padding: 3px 10px;
}
#hamburger-icon div{
width: 25px;
height:3px;
background-color: #fff;
margin: 5px 0;
transition: all 0.3s ease 0s;
}
.open .bar1{
-webkit-transform: rotate(-45deg) translate(-6px, 5px);
transform: rotate(-45deg) translate(-6px, 5px);
}
.open .bar2{
opacity: 0;
}
.open .bar3{
-webkit-transform: rotate(45deg) translate(-6px,-6px);
transform: rotate(45deg) translate(-6px,-6px);
}
.open .mobile-menu{
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
position: absolute;
}
.mobile-menu{
display: none;
position: fixed;
top: 24px;
left: 0;
width: 100%;
height: calc(100vh - 50px);
overflow: hidden;
height: auto;
text-align: center;
background: #007991; /* fallback for old browsers */
background: -webkit-linear-gradient(to left, #78ffd6, #007991); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #78ffd6, #007991); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
color: #fff;
z-index:100;
}
.mobile-menu li{
padding : 10px;
font-weight: 400 !important;
}
.mobile-menu li a{
color: #fff;
}
.mobile-menu li:hover{
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
#media(max-width: 768px){
header{
height: 40px;
}
.logo{
height: 25px;
width: 25px;
margin: 8px 10px;
}
header nav,header .access{
display: none;
}
#hamburger-icon{
display: block;
padding: 2px 7px;
margin-right: 5px;
}
#hamburger-icon div{
width: 20px;
height:3px;
}
.mobile-menu li{
margin-right: 15px;
}
}
media(min-width: 769px) and (max-width: 1020px){
.logo{
margin: 10px;
}
nav ul li{
padding-left: 10px;
font-size: 16px;
}
nav ul li a{
padding: 5px;
}
}
#media(min-width: 250px) and (max-width: 281px){
.logo{
margin-left: -10px;
}
#hamburger-icon{
margin-right: -10px;
}
}
#media(min-width: 282px) and (max-width: 320px){
.logo{
margin-left: -10px;
}
#hamburger-icon{
margin-right: -10px;
}
}
/*Card*/
.card{
min-width: 15rem;
flex: 1;
-webkit-box-flex: 1;
-ms-flex: 1;
height: 100%;
width: 100%;
border: 1px solid #ccc;
background: #fff;
font-weight: 300 !important;
position: relative;
}
.card .category{
position: absolute;
top: -10px;
left: 0;
background: #FF7F50;
color: #fff;
font-weight: 300 !important;
padding: 5px 9px;
font-size: 10px;
text-transform: uppercase;
}
.card .flag{
top:0;
right: -15px;
position: absolute;
}
.card .flag button{
position: absolute;
top: -10px;
right: 0;
background: 0;
color: #fff;
font-size: 20px;
}
.flag #report{
display:none;
float: left;
padding:0;
margin-top: 22px;
margin-right: 22px;
background: #fff;
color: #007bff;
}
#report p{
padding: 2px 5px;
top:-10px;
font-size:10px;
line-height:0.1rem;
cursor:pointer;
}
.card img{
flex-wrap: wrap;
pointer-events: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
width: 100%;
float: none;
display:block;z
object-fit: fill;
height: 180px;
}
.card-panel{
display: flex;
align-items: center;
justify-content: center;
margin-top: -10px;
}
.card-panel .icon{
cursor: pointer;
display: flex;
/*flex-direction: row;*/
align-items: center;
justify-content: center;
position: relative;
z-index: 1;
}
.card-panel .icon img{
height: 60px;
width: 60px;
border: 5px solid #FFF;
border-radius: 50%;
background-color: #007bff;
text-align: center;
color: #fff;
margin: -25px 10px 0 10px;
pointer-events: none;
cursor: pointer;
}
.card-panel .icon i{
font-size: 15px;
line-height: 30px;
height: 40px;
width: 40px;
border: 5px solid #fff;
border-radius: 50%;
background-color: #007bff;
text-align: center;
color: #fff;
margin: -20px 5px 0 5px;
}
.card-panel .icon .tooltip,
.card-panel .icon .tooltip1{
text-align: center;
position: absolute;
top: 0;
background: #fff;
color: #007bff;
font-size: 10px;
padding: 10px 10px;
border-radius: 25px;
box-shadow: 0 10px 10px rgba(0,0,0,0.1);
opacity: 0;
pointer-events: none;
z-index: 1;
transition: all 0.2s cubic-bezier(0.68,-0.55,0.265,1.55);
}
.card-panel .icon .tooltip:before,
.card-panel .icon .tooltip1:before{
position: absolute;
content: "";
height: 7px;
width: 7px;
background:#fff;
bottom: -3px;
left: 50%;
transform: translate(-50%) rotate(45deg);
transition: all 0.2s cubic-bezier(0.68,-0.55,0.265,1.55);
}
.card-panel .icon:hover .tooltip,
.card-panel .icon:focus .tooltip{
position: absolute;
top: -60px;
opacity: 1;
pointer-events: auto;
}
.card-panel .icon:hover .tooltip1,
.card-panel .icon:focus .tooltip1{
top: -92px;
opacity: 1;
pointer-events: auto;
text-align: center;
}
.card-panel .icon:hover i,
.card-panel .icon:active i,
.card-panel .icon:hover .tooltip,
.card-panel .icon:focus .tooltip,
.card-panel .icon .tooltip1:before{
text-shadow: 0px -1px 0px rgba(0,0,0,0.4);
}
.card-panel .tooltip1 i{
font-size: 8px;
line-height:13px;
height: 20px;
width: 20px;
border: 3px solid #fff;
border-radius: 50%;
background-color: #007bff;
text-align: center;
color: #fff;
margin: -20px 5px 0 5px;
}
.card .text {
padding: 10px 10px;
}
.card .text h3{
margin-top: 0;
text-align: justify;
text-justify: inter-word;
font-weight: 500 !important;
}
.card button{
background-color: #007bff;
border-radius: 10px;
color:#fff;
padding: 10px 20px;
border: none;
cursor: pointer;
position: relative;
margin: 0 auto;
display: block;
}
.card button:hover{
opacity: 0.8;
}
.card .see-more{
top: 40%;
text-align: center;
position: relative;
}
.card .see-more i{
font-size: 60px;
color:#007bff;
}
.container-a,
.container-b{
margin:10px auto;
padding:0;
width: calc(100% - 100px);
position:relative;
}
.wrapper{
height:100%;
display:grid;
grid-template-columns:repeat(5, 1fr);
grid-template-areas: "blog-container blog-container blog-container blog-container blog-sidebar";
grid-gap:10px;
}
.wrapper .blog-container{
grid-area: blog-container;
}
.wrapper .blog-sidebar{
grid-area: blog-sidebar;
}
.wrapper .blog-container span,
.wrapper .blog-sidebar span{
background-color: #007bff;
padding: 5px 10px;
position:relative;
color: #fff;
z-index: -1;
background-blend-mode: multiply;
font-family: 'Roboto', sans-serif !important;
}
.blog-container hr,
.blog-sidebar hr{
width: 100%;
color:#007bff;
margin-top: 3.5px;
position: relative;
z-index: -2;
}
.blog-container .blog-cards{
display: grid;
grid-template-columns: repeat(auto-fill, minmax(270px,1fr));
grid-gap: 10px;
}
.widgets{
background: #fff;
border: 1px solid #ccc;
margin-bottom: 10px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(270px,1fr));
grid-gap: 10px;
padding: 5px;
}
.widgets img{
width: 100%;
float: none;
display:block;
object-fit: fill;
}
.container-a .widgets,.container-b .widgets{
margin-bottom: 10px;
}
.load-more{
text-align: center;
grid-column: 1/-1;
margin-bottom: 10px;
}
.load-more button{
padding: 9px 150px;
background-color: rgba(0, 136, 169, 1);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
color: #fff;
font-size: 13px;
}
.load-more button:hover{
background: rgba(0, 136, 169, 0.8);
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
/*--MEDIA QUERIES--*/
#media(max-width: 768px){
.carousel{
width: calc(100% - 60px);
margin: 10px auto;
}
.carousel span,
.wrapper .blog-container span,
.wrapper .blog-sidebar span{
font-size: 12px;
}
.carousel hr{
margin-top: 3px;
}
.horizontal-scroll .btn-scroll{
padding: 0 5px;
font-size: 30px;
}
.horizontal-scroll #btn-scroll-left{
top: calc(430px/2);
}
.horizontal-scroll #btn-scroll-right{
top: calc(430px/2);
}
.container-a,
.container-b{
width: 99%;
padding: 5px;
}
.wrapper{
grid-template-rows: auto;
grid-template-columns: 1fr;
grid-template-areas: "blog-container"
"blog-sidebar";
}
.card{
min-width: 14.8rem;
}
.card .category{
font-size: 8px;
padding: 4px 7px;
top: -8px;
}
.card img{
height: 150px;
}
.card .flag{
right: -7px;0
}
.card .flag button{
font-size: 15px;
top: -5px;
}
.flag #report{
margin-top: 17px;
margin-right: 12px;
}
#report p{
padding: 1px 4px;
font-size:9px;
}
.card-panel .icon i{
font-size: 10px;
line-height: 22px;
height: 30px;
width: 30px;
margin: -12px 4px 0 4px;
border: 4px solid #FFF;
}
.card-panel .icon img{
width: 50px;
height: 50px;
border: 4px solid #FFF;
margin: -20px 10px 0 10px;
}
.card-panel .icon .tooltip,
.card-panel .icon .tooltip1{
padding: 8px 8px;
font-size: 8px;
}
.card-panel .icon .tooltip:before,
.card-panel .icon .tooltip1:before{
width: 5px;
height: 5px;
bottom: -2px;
}
.card-panel .icon:hover .tooltip{
top: -45px;
}
.card-panel .icon:hover .tooltip1{
top: -75px;
}
.card-panel .tooltip1 i{
font-size: 8px;
line-height:14px;
height: 18px;
width: 18px;
border: 2px solid #fff;
}
.card .text h3{
font-size: 15px;
}
.card button{
padding: 5px 10px;
font-size: 12px;
}
.widgets{
grid-template-columns: repeat(auto-fill, minmax(244px,1fr));
}
.card .see-more{
top: 40%;
}
.card .see-more i{
font-size: 50px;
}
.load-more button{
padding: 5px 30px;
font-size: 12px;
}
}
#media(max-width: 281px) {
.wrapper .blog-container {
padding-right: 0;
}
.blog-container .blog-cards {
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
}
.widgets {
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
}
}
<section class="body-content">
<header>
<img src="img/Logo.jpg" class="logo" alt="Logo">
<nav>
<ul>
<li class="active"><i class="fas fa-home"></i> Home</li>
<li><i class="fas fa-pen-nib"></i> Blogs</li>
<li><i class="far fa-images"></i> product</li>
</ul>
</nav>
<ul class="access">
<li><button class="accessBtn"><i class="fas fa-sign-in-alt"></i> Access <i class="fas fa-caret-down"></i></button>
<ul class ="access-menu">
<li id="signup">Signup</li>
<li id="signin">Signin</li>
</ul>
</li>
</ul>
<div id="hamburger-icon" onclick="toggleMobileMenu(this)">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
<ul class="mobile-menu">
<li class="active"><i class="fas fa-home"></i> Home</li>
<li><i class="fas fa-pen-nib"></i> contact</li>
<li><i class="far fa-images"></i> Product</li>
<li>Signup</li>
<li>Signin</li>
</ul>
</div>
</header>
<section class="container-a" aria-label="blog-content">
<div class="wrapper">
<div class="blog-container">
<span>Blogs</span><hr>
<div class="blog-cards">
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div><!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div><!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div><!--card-->
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div><!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div><!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div><!--card-->
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div><!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div><!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div><!--card-->
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div><!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div><!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div><!--card-->
<div class="card">Card5</div>
<div class="load-more">
<button>Load More</button>
</div>
</div><!--cards-->
</div>
<div class="blog-sidebar">
<span>Sidebar</span><hr>
<div class="widgets">
<img src="images/5.jpg">
<img src="images/4.jpeg">
</div>
</div>
</div>
</section>

The problem here is, that you set the .card class a min-width: 14.8rem, so it would be bigger than the actual body with at a certian point. You can resolve this by remove the absolute min-width.
Working code:
function toggleMobileMenu(menu) {
menu.classList.toggle('open');
}
function toggleSidebar(menu) {
menu.classList.toggle('open');
}
html {
height: 100%;
box-sizing: border-box;
}
*,
*:after,
*:before {
box-sizing: inherit;
}
body {
position: relative;
min-height: 100%;
min-width: 100%;
box-sizing: border-box;
margin: 0;
padding-bottom: 12rem;
font-family: 'Roboto', sans-serif !important;
background: #f2f2f2;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.body-content {
padding-bottom: 0.5rem;
width: 100%;
}
/*Main ends here*/
/*Global*/
h2 {
color: #007bff;
font-size: 20px;
}
li,
a {
list-style: none;
text-decoration: none;
}
.button {
padding: 9px 25px;
background-color: rgba(0, 136, 169, 1);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
color: #fff;
}
/*Global*/
header {
padding: 0 20px;
background: #007991;
/* fallback for old browsers */
background: -webkit-linear-gradient(to left, #78ffd6, #007991);
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #78ffd6, #007991);
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
-webkit-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.75);
height: 50px;
width: 100%;
min-width: 100%;
display: flex;
justify-content: space-between;
z-index: 1001;
position: -moz-sticky;
position: -webkit-sticky;
position: sticky;
top: 0;
}
.logo {
width: 30px;
height: 30px;
justify-self: start;
margin: 10px 20px;
cursor: pointer;
}
header nav {
overflow: hidden;
margin-right: auto;
}
header nav ul {
list-style: none;
}
header nav ul li {
display: inline-block;
padding-left: 20px;
}
.active a {
color: #fff;
}
header nav ul li:hover {
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
header nav ul li a {
color: #f2f3f5;
padding: 10px;
text-decoration: none;
font-weight: 400 !important;
}
header nav ul li a:hover {
color: #fff;
font-weight: 400 !important;
}
.access {
margin: 9px;
list-style: none;
display: block;
position: relative;
z-index: 100;
}
.access button {
padding: 9px 25px;
background-color: rgba(0, 136, 169, 1);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
color: #fff;
}
.access button:hover {
background: rgba(0, 136, 169, 0.8);
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
.access li {
list-style: none;
cursor: pointer;
}
.access li a {
text-decoration: none;
}
.access li ul {
background-color: rgba(0, 136, 169, 1);
display: none;
/*submenu dissappears when set to none*/
text-align: center;
padding: 10px 25px;
margin-top: 8px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.access li:hover ul {
display: block;
}
.access-menu li a {
color: #fff !important;
font-weight: 400!important;
}
.access-menu.reveal {
display: block;
}
.access li ul li {
padding: 5px;
color: #fff;
display: block;
font-weight: 500;
}
.access li ul li:hover {
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
/*mobile-menu*/
#hamburger-icon {
margin: auto 0;
display: none;
cursor: grab;
background: rgba(0, 136, 169, 1);
border-radius: 5px;
padding: 3px 10px;
}
#hamburger-icon div {
width: 25px;
height: 3px;
background-color: #fff;
margin: 5px 0;
transition: all 0.3s ease 0s;
}
.open .bar1 {
-webkit-transform: rotate(-45deg) translate(-6px, 5px);
transform: rotate(-45deg) translate(-6px, 5px);
}
.open .bar2 {
opacity: 0;
}
.open .bar3 {
-webkit-transform: rotate(45deg) translate(-6px, -6px);
transform: rotate(45deg) translate(-6px, -6px);
}
.open .mobile-menu {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
position: absolute;
}
.mobile-menu {
display: none;
position: fixed;
top: 24px;
left: 0;
width: 100%;
height: calc(100vh - 50px);
overflow: hidden;
height: auto;
text-align: center;
background: #007991;
/* fallback for old browsers */
background: -webkit-linear-gradient(to left, #78ffd6, #007991);
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #78ffd6, #007991);
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
color: #fff;
z-index: 100;
}
.mobile-menu li {
padding: 10px;
font-weight: 400 !important;
}
.mobile-menu li a {
color: #fff;
}
.mobile-menu li:hover {
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
#media(max-width: 768px) {
header {
height: 40px;
}
.logo {
height: 25px;
width: 25px;
margin: 8px 10px;
}
header nav,
header .access {
display: none;
}
#hamburger-icon {
display: block;
padding: 2px 7px;
margin-right: 5px;
}
#hamburger-icon div {
width: 20px;
height: 3px;
}
.mobile-menu li {
margin-right: 15px;
}
}
media(min-width: 769px) and (max-width: 1020px) {
.logo {
margin: 10px;
}
nav ul li {
padding-left: 10px;
font-size: 16px;
}
nav ul li a {
padding: 5px;
}
}
#media(min-width: 250px) and (max-width: 281px) {
.logo {
margin-left: -10px;
}
#hamburger-icon {
margin-right: -10px;
}
}
#media(min-width: 282px) and (max-width: 320px) {
.logo {
margin-left: -10px;
}
#hamburger-icon {
margin-right: -10px;
}
}
/*Card*/
.card {
min-width: 15rem;
flex: 1;
-webkit-box-flex: 1;
-ms-flex: 1;
height: 100%;
width: 100%;
border: 1px solid #ccc;
background: #fff;
font-weight: 300 !important;
position: relative;
}
.card .category {
position: absolute;
top: -10px;
left: 0;
background: #FF7F50;
color: #fff;
font-weight: 300 !important;
padding: 5px 9px;
font-size: 10px;
text-transform: uppercase;
}
.card .flag {
top: 0;
right: -15px;
position: absolute;
}
.card .flag button {
position: absolute;
top: -10px;
right: 0;
background: 0;
color: #fff;
font-size: 20px;
}
.flag #report {
display: none;
float: left;
padding: 0;
margin-top: 22px;
margin-right: 22px;
background: #fff;
color: #007bff;
}
#report p {
padding: 2px 5px;
top: -10px;
font-size: 10px;
line-height: 0.1rem;
cursor: pointer;
}
.card img {
flex-wrap: wrap;
pointer-events: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
width: 100%;
float: none;
display: block;
z object-fit: fill;
height: 180px;
}
.card-panel {
display: flex;
align-items: center;
justify-content: center;
margin-top: -10px;
}
.card-panel .icon {
cursor: pointer;
display: flex;
/*flex-direction: row;*/
align-items: center;
justify-content: center;
position: relative;
z-index: 1;
}
.card-panel .icon img {
height: 60px;
width: 60px;
border: 5px solid #FFF;
border-radius: 50%;
background-color: #007bff;
text-align: center;
color: #fff;
margin: -25px 10px 0 10px;
pointer-events: none;
cursor: pointer;
}
.card-panel .icon i {
font-size: 15px;
line-height: 30px;
height: 40px;
width: 40px;
border: 5px solid #fff;
border-radius: 50%;
background-color: #007bff;
text-align: center;
color: #fff;
margin: -20px 5px 0 5px;
}
.card-panel .icon .tooltip,
.card-panel .icon .tooltip1 {
text-align: center;
position: absolute;
top: 0;
background: #fff;
color: #007bff;
font-size: 10px;
padding: 10px 10px;
border-radius: 25px;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
opacity: 0;
pointer-events: none;
z-index: 1;
transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.card-panel .icon .tooltip:before,
.card-panel .icon .tooltip1:before {
position: absolute;
content: "";
height: 7px;
width: 7px;
background: #fff;
bottom: -3px;
left: 50%;
transform: translate(-50%) rotate(45deg);
transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.card-panel .icon:hover .tooltip,
.card-panel .icon:focus .tooltip {
position: absolute;
top: -60px;
opacity: 1;
pointer-events: auto;
}
.card-panel .icon:hover .tooltip1,
.card-panel .icon:focus .tooltip1 {
top: -92px;
opacity: 1;
pointer-events: auto;
text-align: center;
}
.card-panel .icon:hover i,
.card-panel .icon:active i,
.card-panel .icon:hover .tooltip,
.card-panel .icon:focus .tooltip,
.card-panel .icon .tooltip1:before {
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.4);
}
.card-panel .tooltip1 i {
font-size: 8px;
line-height: 13px;
height: 20px;
width: 20px;
border: 3px solid #fff;
border-radius: 50%;
background-color: #007bff;
text-align: center;
color: #fff;
margin: -20px 5px 0 5px;
}
.card .text {
padding: 10px 10px;
}
.card .text h3 {
margin-top: 0;
text-align: justify;
text-justify: inter-word;
font-weight: 500 !important;
}
.card button {
background-color: #007bff;
border-radius: 10px;
color: #fff;
padding: 10px 20px;
border: none;
cursor: pointer;
position: relative;
margin: 0 auto;
display: block;
}
.card button:hover {
opacity: 0.8;
}
.card .see-more {
top: 40%;
text-align: center;
position: relative;
}
.card .see-more i {
font-size: 60px;
color: #007bff;
}
.container-a,
.container-b {
margin: 10px auto;
padding: 0;
width: calc(100% - 100px);
position: relative;
}
.wrapper {
height: 100%;
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-template-areas: "blog-container blog-container blog-container blog-container blog-sidebar";
grid-gap: 10px;
}
.wrapper .blog-container {
grid-area: blog-container;
}
.wrapper .blog-sidebar {
grid-area: blog-sidebar;
}
.wrapper .blog-container span,
.wrapper .blog-sidebar span {
background-color: #007bff;
padding: 5px 10px;
position: relative;
color: #fff;
z-index: -1;
background-blend-mode: multiply;
font-family: 'Roboto', sans-serif !important;
}
.blog-container hr,
.blog-sidebar hr {
width: 100%;
color: #007bff;
margin-top: 3.5px;
position: relative;
z-index: -2;
}
.blog-container .blog-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
grid-gap: 10px;
}
.widgets {
background: #fff;
border: 1px solid #ccc;
margin-bottom: 10px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
grid-gap: 10px;
padding: 5px;
}
.widgets img {
width: 100%;
float: none;
display: block;
object-fit: fill;
}
.container-a .widgets,
.container-b .widgets {
margin-bottom: 10px;
}
.load-more {
text-align: center;
grid-column: 1/-1;
margin-bottom: 10px;
}
.load-more button {
padding: 9px 150px;
background-color: rgba(0, 136, 169, 1);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
color: #fff;
font-size: 13px;
}
.load-more button:hover {
background: rgba(0, 136, 169, 0.8);
transform: scale(1.1);
transition: all 0.3s ease 0s;
}
/*--MEDIA QUERIES--*/
#media(max-width: 768px) {
.carousel {
width: calc(100% - 60px);
margin: 10px auto;
}
.carousel span,
.wrapper .blog-container span,
.wrapper .blog-sidebar span {
font-size: 12px;
}
.carousel hr {
margin-top: 3px;
}
.horizontal-scroll .btn-scroll {
padding: 0 5px;
font-size: 30px;
}
.horizontal-scroll #btn-scroll-left {
top: calc(430px/2);
}
.horizontal-scroll #btn-scroll-right {
top: calc(430px/2);
}
.container-a,
.container-b {
width: 99%;
padding: 5px;
}
.wrapper {
grid-template-rows: auto;
grid-template-columns: 1fr;
grid-template-areas: "blog-container" "blog-sidebar";
}
.card {
min-width: 100%;
}
.card .category {
font-size: 8px;
padding: 4px 7px;
top: -8px;
}
.card img {
height: 150px;
}
.card .flag {
right: -7px;
0
}
.card .flag button {
font-size: 15px;
top: -5px;
}
.flag #report {
margin-top: 17px;
margin-right: 12px;
}
#report p {
padding: 1px 4px;
font-size: 9px;
}
.card-panel .icon i {
font-size: 10px;
line-height: 22px;
height: 30px;
width: 30px;
margin: -12px 4px 0 4px;
border: 4px solid #FFF;
}
.card-panel .icon img {
width: 50px;
height: 50px;
border: 4px solid #FFF;
margin: -20px 10px 0 10px;
}
.card-panel .icon .tooltip,
.card-panel .icon .tooltip1 {
padding: 8px 8px;
font-size: 8px;
}
.card-panel .icon .tooltip:before,
.card-panel .icon .tooltip1:before {
width: 5px;
height: 5px;
bottom: -2px;
}
.card-panel .icon:hover .tooltip {
top: -45px;
}
.card-panel .icon:hover .tooltip1 {
top: -75px;
}
.card-panel .tooltip1 i {
font-size: 8px;
line-height: 14px;
height: 18px;
width: 18px;
border: 2px solid #fff;
}
.card .text h3 {
font-size: 15px;
}
.card button {
padding: 5px 10px;
font-size: 12px;
}
.widgets {
grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
}
.card .see-more {
top: 40%;
}
.card .see-more i {
font-size: 50px;
}
.load-more button {
padding: 5px 30px;
font-size: 12px;
}
}
#media(max-width: 281px) {
.wrapper .blog-container {
padding-right: 0;
}
.blog-container .blog-cards {
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
}
.widgets {
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
}
}
<section class="body-content">
<header>
<img src="img/Logo.jpg" class="logo" alt="Logo">
<nav>
<ul>
<li class="active"><i class="fas fa-home"></i> Home</li>
<li><i class="fas fa-pen-nib"></i> Blogs</li>
<li><i class="far fa-images"></i> product</li>
</ul>
</nav>
<ul class="access">
<li><button class="accessBtn"><i class="fas fa-sign-in-alt"></i> Access <i class="fas fa-caret-down"></i></button>
<ul class="access-menu">
<li id="signup">Signup</li>
<li id="signin">Signin</li>
</ul>
</li>
</ul>
<div id="hamburger-icon" onclick="toggleMobileMenu(this)">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
<ul class="mobile-menu">
<li class="active"><i class="fas fa-home"></i> Home</li>
<li><i class="fas fa-pen-nib"></i> contact</li>
<li><i class="far fa-images"></i> Product</li>
<li>Signup</li>
<li>Signin</li>
</ul>
</div>
</header>
<section class="container-a" aria-label="blog-content">
<div class="wrapper">
<div class="blog-container">
<span>Blogs</span>
<hr>
<div class="blog-cards">
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div>
<!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div>
<!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div>
<!--card-->
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div>
<!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div>
<!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div>
<!--card-->
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div>
<!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div>
<!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div>
<!--card-->
<div class="card">
<img src="images/1.jpg">
<p class="category">Fashion</p>
<div class="flag">
<button onclick=myFunction()>&#8942</button>
<div id="report">
<p>Report</p>
<p>Not-interested</p>
</div>
</div>
<!--flag-->
<div class="card-panel">
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-star"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-comment"></i>
</div>
<div class="icon">
<div class="tooltip1"><i class="fas fa-crown"></i>Umananda goswami
</div>
<img src="images/4.jpeg">
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-user-plus"></i>
</div>
<div class="icon">
<div class="tooltip">14.1k</div>
<i class="fas fa-share"></i>
</div>
</div>
<!--card-panel-->
<div class="text">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod</h3>
<button>Read it</button>
</div>
</div>
<!--card-->
<div class="card">Card5</div>
<div class="load-more">
<button>Load More</button>
</div>
</div>
<!--cards-->
</div>
<div class="blog-sidebar">
<span>Sidebar</span>
<hr>
<div class="widgets">
<img src="images/5.jpg">
<img src="images/4.jpeg">
</div>
</div>
</div>
</section>
So the problem was fixed by changing min-width to 100% insted of a absolute value in line 601 at your css file.

Related

Content is scattered (Google searches did not help at all)

body {
font-family: Bahnschrift SemiBold, sans-serif;
background-color: #fcfefe;
width: 100%;
height: 100%;
overflow-x: hidden;
}
*{
margin:0; padding: 0;
}
.logonav{
position: top;
left: 0px;
width: 250px;
height: 65px;
padding-top: 70px;
padding-bottom: 20px;
padding-left: 40px;
}
.content{
position: absolute;
bottom: 330px;
left: 30px;
text-align: justify;
font-size: 20px;
font-family: 'Titillium Web', sans-serif;
color: #ffffff;
}
.bn632-hover {
position: absolute;
bottom: 200px;
left: 1200px;
width: 160px;
font-size: 16px;
font-weight: 600;
color: #00bbf0;
cursor: pointer;
margin: 20px;
height: 55px;
text-align:center;
color: whitesmoke;
border: none;
background-size: 300% 100%;
border-radius: 50px;
moz-transition: all .4s ease-in-out;
-o-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out;
transition: all .4s ease-in-out;
}
.bn632-hover:hover {
background-position: 100% 0;
moz-transition: all .4s ease-in-out;
-o-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out;
transition: all .4s ease-in-out;
}
.bn632-hover:focus {
outline: none;
}
.bn632-hover.bn18 {
background-image: linear-gradient(
to right,
#25aae1,
#00bbf0,
#00bbf0,
#00bbf0
);
box-shadow: 0 4px 15px 0 rgba(49, 196, 190, 0.75);
}
.image_container.img{
max-height: 100vh;
max-width: 100%;
object-fit: cover;
object-position: bottom;
}
.pozadina{
background-color: #83a3c7;
background-image: url("womandoctor.jpg");
background-size: cover;
width: 110%;
background-blend-mode: normal;
position: relative;
padding-top: 450px;
padding-bottom: 100px;
}
.hornav1{
overflow: hidden;
width: 100%;
background-color: #00bbf0;
list-style-type: none;
margin: 0px;
padding: 0px;
border-bottom: solid 2px #eaf6f6;
size: 100px;
position:fixed;
top:0;
z-index:100;
}
.hornav1 a{
float: right;
color: whitesmoke;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
box-sizing: border-box;
margin-left: 5px 10 px;
}
.hornav1 i{
color: whitesmoke;
}
#pocetna{
padding-right: 1000px;
font-size: 20px;
}
.hornav2{
overflow: hidden;
width: 100%;
background-color: #ffffff;
list-style-type: none;
margin: 0px;
padding: 0px;
position: sticky;
top: 0px;
border-bottom: solid 2px #eaf6f6;
}
.hornav2 a{
float: right;
color: #333;
text-align: center;
padding: 14px 16px;
font-size: 17px;
box-sizing: border-box;
margin-left: 5px 10 px;
}
.hornav3{
overflow: hidden;
width: 100%;
background-color: #00bbf0;
list-style-type: none;
margin: 0px;
padding: 10px;
position:sticky;
border-bottom: solid 2px #eaf6f6;
size: 150px;
}
.hornav3 a{
position: relative;
color: whitesmoke;
text-align: center;
padding-left: 50px;
text-decoration: none;
font-size: 24px;
box-sizing: border-box;
right : -270px;
}
.navcontainer{
top:0;
width:100%;
z-index:100;
}
.hornav3 a::before{
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 0;
height: 2px;
background-color: whitesmoke;
transition: width 0.6s cubic-bezier(0.5, 1, 0.5, 1);
}
#media (hover: hover) and (pointer: fine) {
.hornav3 a:hover::before{
left: 0.5;
right: auto;
width: 70%;
}
}
.pregledi{
background-color: #fafafa;
}
.pregledi .heading{
padding-top: 40px;
text-transform: uppercase;
color: deepskyblue;
text-align: center;
font-size: 35px;
}
.pregledi .heading2{
padding-top: 5px;
text-align: center;
font-size: 20px;
font-family: unset;
color: #2c5d63;
}
.pregledi .box-container{
padding-top: 30px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(20rem, 7fr));
gap:4rem;
margin-left: 60px;
margin-right: 30px;
}
.pregledi .box-container .box h3{
padding-top: 10px;
color: deepskyblue;
text-transform: uppercase;
font-size: 2.1rem;
}
.pregledi .box-container .box p{
padding-top: 10px;
font-family: sans-serif;
font-size: 1rem;
line-height: 1;
}
.pregledi .box-container .box a{
position: relative;
top: 10px;
}
.bn111 {
margin-top: 10px;
padding: 1.3em 0.01em;
font-size: 12px;
text-transform: uppercase;
text-indent: 10px;
letter-spacing: 2.5px;
font-weight: 500;
color: #ffffff;
background-color: #00bbf0;
border: none;
border-radius: 45px;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
transition: all 0.24s ease 0s;
cursor: pointer;
outline: none;
}
.bn111:hover {
background-color: #00bbf0;
box-shadow: 0px 15px 20px rgba(34, 180, 255, 0.4);
color: #ffffff;
transform: translateX(7px) translateY(-1.1px);
}
.bn111:active {
transform: translateY(-1px);
}
.bn111 i{
color: #ffffff;
font-size: 1.3em;
padding-right: 4px;
}
.izborna{
background-color: #83a3c7;
background-size: cover;
width: 100%;
background-blend-mode: normal;
opacity: 1;
display: block;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
.containerslike{
position: relative;
width: 100%;
max-width: 400px;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .3s ease;
background-color: #ececec;
}
.containerslike:hover .overlay {
opacity: 0.5;
}
.ikona {
color: deepskyblue;
font-size: 40px;
position: absolute;
top: 100%;
left: 45%;;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
opacity: 1;
}
.fa-magnifying-glass{
position: absolute;
top: 100px;
}
.bn112 {
margin-top: 10px;
padding: 1.3em 0.01em;
font-size: 18px;
text-transform: uppercase;
text-indent: 10px;
letter-spacing: 2.5px;
font-weight: 500;
color: #ffffff;
background-color: #00bbf0;
border: none;
border-radius: 45px;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
transition: all 0.24s ease 0s;
cursor: pointer;
outline: none;
width: 400px;
}
.bn112:hover {
background-color: #00bbf0;
box-shadow: 0px 15px 20px rgba(34, 180, 255, 0.4);
color: #ffffff;
transform: translateY(-1.1px);
}
.bn112:active {
transform: translateY(-1px);
}
.bn112 i{
color: #ffffff;
font-size: 1.3em;
padding-right: 4px;
}
.podnopregled{
margin-left: 500px;
}
.infodiv{
margin-top: 30px;
background-color: deepskyblue;
}
.row {
display: flex;
width: 100%;
}
.noMargin {
margin: 1px;
}
.one {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 30px;
}
.two {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 30px;
}
.three {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 10px;
}
.four {
background-color: #79c2d0;
border: solid #ececec;
height: 300px;
width: 100%;
border-radius: 15px;
margin-top: 10px;
}
.noMargin p{
text-align: center;
margin-top: 100px;
}
#media only screen and (max-width:800px) {
/* For tablets: */
.main {
width: 80%;
padding: 0;
}
.right {
width: 100%;
}
}
#media only screen and (max-width:500px) {
/* For mobile phones: */
.menu, .main, .right {
width: 100%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>VivaMed medicina rada i sporta</title>
<script src="https://kit.fontawesome.com/60681a69ff.js" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="VivamedCSS.css">
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:wght#300&display=swap" rel="stylesheet">
</head>
<body>
<div class="navcontainer">
<div class="hornav1">
<i class="fas fa-envelope" style="font-size:20px;"></i> info#vivamed.hr
<i class="fa-solid fa-phone"style="font-size:20px;" ></i> +385 1 233 55 00
Početna
</div>
<div class="hornav2">
<img src="vivalogo.webp" alt="logo" class="logonav">
<a class="active" style="font-size: 20px; padding-right: 550px; padding-top: 100px; font-family: 'Titillium Web', sans-serif; font-style: italic; font-weight: bolder;"> Zdrav radnik je uspješan i produktivan radnik.</a>
</div>
<div class="hornav3">
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-envelope" style="font-size:20px;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-cloud" style="font-size:20px; color: whitesmoke;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-comment" style="font-size:20px;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/kontakt"><i class="fas fa-car" style="font-size:20px;"></i> Kontakt</a>
<a class="active" href="https://www.vivamed.hr/galerija"><i class="fas fa-bolt" style="font-size:20px;"></i> O nama</a>
<a class="active" href="file:///C:/Users/Admin/Desktop/Vivamed/VIVAMED%20JEDAN.html#slide-2"><i class="fas fa-envelope"></i> Početna</a>
</div>
</div>
<div class="pozadina">
<div class="content">
<h3>Dobro došli na stranicu Medicine rada i sporta VivaMed!</h3>
<p>Pogledajte sve profesionalne usluge koje nudi
<br>naš tim vrhunskih i renomiranih stručnjaka!
</p>
</div>
<button class="bn632-hover bn18">Naručite se!</button>
</div>
<section class="pregledi" id="pregledi">
<h1 class="heading"> <span> Stručno, brzo i povoljno! </span> </h1>
<h2 class="heading2"> <span>Izdvojeni pregledi</span></h3>
<div class="box-container">
<div class="box">
<div class="containerslike">
<img src="pexels-pixabay-262524.jpg" class="izborna">
<div class="overlay">
<a href="https://www.vivamed.hr/usluge/pregledi" class="ikona">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
<h3>Pregled sportaša</h3>
<p>Rekreativci, amateri, profesionalci</p>
<button class="bn111" id="bn111"> Opširnije<i class="fa-solid fa-arrow-right"></i></button>
</div>
<div class="box">
<div class="containerslike">
<img src="delivery-driver-smiling-camera-his-van_13339-235836.jpg" class="izborna">
<div class="overlay">
<a href="https://www.vivamed.hr/usluge/pregledi" class="ikona">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
<h3>Pregled vozača</h3>
<p>Sve vrste kategorija i pregleda</p>
<button class="bn111" id="bn111"> Opširnije<i class="fa-solid fa-arrow-right"></i></button>
</div>
<div class="box">
<div class="containerslike">
<img src="happy-graduate-woman-mantle-rejoicing-laughing-smiling_176420-14226.webp" class="izborna">
<div class="overlay">
<a href="https://www.vivamed.hr/usluge/pregledi" class="ikona">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
<h3>Učenici i studenti</h3>
<p>Upisi u srednje škole, fakultete i druge akadamske ustanove</p>
<button class="bn111" id="bn111"> Opširnije<i class="fa-solid fa-arrow-right"></i></button>
</div>
<div class="podnopregled">
<button class="bn112" id="bn112"> Svi pregledi<i class="fa-solid fa-arrow-right"></i></button>
</div>
</div>
</section>
<!--
-->
<div class="infodiv">
<div class="row noMargin">
<div class="one">
<p>Radno vrijeme<br>
ponedjeljak 07 - 15
utorak 07 - 18
srijeda 07 - 14
četvrtak 07 - 14
petak 07 - 14
i prema dogovoru </p>
</div>
<div class="two">
<p>Adresa<br>
Krešićeva ul. 32/1. Kat (okretište tramvaja Borongaj)</p>
</div>
</div>
<div class="row noMargin">
<div class="three">
<p>Email<br>
info#vivamed.hr</p>
</div>
<div class="four">
<p>Telefon<br>
+385 1 233 55 00</p>
</div>
</div>
</div>
</body>
</html>
I've been coding a website in html,css and used some javascript scripts to do it. It is a medical website and so far I've done a lot to the main page which is my main problem here. I am self-taught and all the paddings, margins and screen-fits that I've coded into it are were actually applying only to the screen size that is on my laptop, and not others. I've tested this by uploading the files to InfintyFree and making it online just for the sake of testing it on other screens, and what happens is that all the content is scattered around the screen. I've put some pictures to show how it looks in comparison with my laptop, other laptop that I have and my phone. Also I've put the html and css code if you can check it out and see where I screwed up and just point me to the core because I really cannot comprehend what is going on.
Thank in advance, and sorry if there was a question like this before, because I haven't found one.[][]
I have tried putting the *{} and changing properties with it, in the body{}, height, width, overflow, padding, margins, Media only screen, everything. Still, everything fixed but only on my laptop on which it was built.

Navbar content not displaying properly

Hello I'm trying to style my navbar and have everything aligned properly, but I'm not sure what is making my nav content display like this. Also, how can I remove the grey box next to my nav brand? I messed around with it on the inspect elements, but I don't know how to get rid of it. I have provided my code below. Thanks!
When bs css link isn't added (How I want to keep it):
When bs css link is added:
HTML:
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Dashboard UI </title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!---Navbar--->
<header>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a style="font-size: 45px; color: #A388E7;" class="navbar-brand" href="#"><strong>StudioPick</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-curresnt="page" href="index.html">Home</a>
</li>
<li class="nav-item2">
<div class="action">
<div class="profile" onclick="menuToggle();">
<img src="./assets/avatar.jpg" />
</div>
<div class="menu">
<h3 id="profile-name"><strong>User Name</strong></h3>
<p class="text-muted" id="userType" style="position: relative; top: -20px; right: -60px; font-size: 12px !important">Studio</p>
<ul>
<li>
<img src="./assets/icons/user.png" />Dashboard
</li>
<li>
<img src="./assets/icons/edit.png" />Edit profile
</li>
<li>
<img src="./assets/icons/envelope.png" />Inbox
</li>
<li>
<img src="./assets/icons/settings.png" />Setting
</li>
<li><img src="./assets/icons/question.png" />Help</li>
<li>
<img src="./assets/icons/log-out.png" />Logout
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!---Navbar--->
<main class="main">
<div class="responsive-wrapper">
<div class="main-header">
<h1>Settings</h1>
<div class="search">
<input type="text" placeholder="Search" />
<button type="submit">
<i class="ph-magnifying-glass-bold"></i>
</button>
</div>
</div>
<div class="horizontal-tabs">
My details
Profile
Password
Team
Plan
Billing
Email
Notifications
Integrations
API
</div>
<div class="content-header">
<div class="content-header-intro">
<h2>Intergrations and connected apps</h2>
<p>Supercharge your workflow and connect the tool you use every day.</p>
</div>
<div class="content-header-actions">
<a href="#" class="button">
<i class="ph-faders-bold"></i>
<span>Filters</span>
</a>
<a href="#" class="button">
<i class="ph-plus-bold"></i>
<span>Request integration</span>
</a>
</div>
</div>
<div class="content">
<div class="content-panel">
<div class="vertical-tabs">
View all
Developer tools
Communication
Productivity
Browser tools
Marketplace
</div>
</div>
<div class="content-main">
<div class="card-grid">
<article class="card">
<div class="card-header">
<div>
<span><img src="https://assets.codepen.io/285131/zeplin.svg" /></span>
<h3>Zeplin</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Collaboration between designers and developers.</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
<article class="card">
<div class="card-header">
<div>
<span><img src="https://assets.codepen.io/285131/github.svg" /></span>
<h3>GitHub</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Link pull requests and automate workflows.</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
<article class="card">
<div class="card-header">
<div>
<span><img src="https://assets.codepen.io/285131/figma.svg" /></span>
<h3>Figma</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Embed file previews in projects.</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
</div>
</div>
</div>
</div>
</main>
<!-- partial -->
<script src='https://unpkg.com/phosphor-icons'></script><script src="./script.js"></script>
<script>
function menuToggle() {
const toggleMenu = document.querySelector(".menu");
toggleMenu.classList.toggle("active");
}
</script>
<!----More Bootstrap--->
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
<!----More Bootstrap--->
</body>
</html>
CSS:
#import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro: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");
:root {
--c-text-primary: #282a32;
--c-text-secondary: #686b87;
--c-text-action: #404089;
--c-accent-primary: #434ce8;
--c-border-primary: #eff1f6;
--c-background-primary: #ffffff;
--c-background-secondary: #fdfcff;
--c-background-tertiary: #ecf3fe;
--c-background-quaternary: #e9ecf4;
}
body {
line-height: 1.5;
min-height: 100vh;
font-family: "Be Vietnam Pro", sans-serif;
background-color: #E5E5E5 !important;
color: var(--c-text-primary);
}
:focus {
outline: 0;
}
.navbar-light {
background-color: #ffffff;
}
.navbar-nav{
justify-content: space-between;
}
.navbar-brand {
font-size: 45px;
color: #A388E7 !important;
font-weight: bolder;
padding-top: 0.3125rem;
padding-bottom: 0.3125rem;
margin-right: 1rem;
text-decoration: none;
white-space: nowrap;
}
.nav-item{
color: #686868 !important;
font-size: 20px;
position: relative;
right: -1675px !important;
}
.nav-item a {
display: block;
padding: 0.5rem 1rem;
color: #000000;
text-decoration: none;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;
}
#alert{
position: relative;
right: -3px !important;
}
.action {
position: fixed;
top: 20px;
right: 30px;
}
.action .profile {
position: relative;
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
cursor: pointer;
}
.action .profile img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.action .menu {
position: absolute;
top: 120px;
right: -10px;
padding: 10px 20px;
background: #fff;
width: 200px;
box-sizing: 0 5px 25px rgba(0, 0, 0, 0.1);
border-radius: 15px;
transition: 0.5s;
visibility: hidden;
opacity: 0;
}
.action .menu.active {
top: 80px;
visibility: visible;
opacity: 1;
}
.action .menu::before {
content: "";
position: absolute;
top: -5px;
right: 28px;
width: 20px;
height: 20px;
background: #fff;
transform: rotate(45deg);
}
*, ::after, ::before {
box-sizing: border-box;
}
.action .menu h3 {
width: 100%;
text-align: center;
font-size: 18px;
padding: 20px 0;
font-weight: 500;
color: #555;
line-height: 1.5em;
}
.action .menu h3 span {
font-size: 14px;
color: #cecece;
font-weight: 300;
}
.action .menu ul li {
list-style: none;
padding: 16px 0;
border-top: 1px solid rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
}
.action .menu ul li img {
max-width: 20px;
margin-right: 10px;
opacity: 0.5;
transition: 0.5s;
}
.action .menu ul li:hover img {
opacity: 1;
}
.action .menu ul li a {
display: inline-block;
text-decoration: none;
color: #555;
font-weight: 500;
transition: 0.5s;
}
.action .menu ul li:hover a {
color: #9370DB;
}
.responsive-wrapper {
width: 90%;
max-width: 1280px;
margin-left: auto;
margin-right: auto;
}
.button {
font: inherit;
color: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1em;
height: 40px;
border-radius: 8px;
line-height: 1;
border: 2px solid var(--c-border-primary);
color: var(--c-text-action);
font-size: 0.875rem;
transition: 0.15s ease;
background-color: var(--c-background-primary);
}
.button i {
margin-right: 0.5rem;
font-size: 1.25em;
}
.button span {
font-weight: 500;
}
.button:hover, .button:focus {
border-color: var(--c-accent-primary);
color: var(--c-accent-primary);
}
.main {
padding-top: 3rem;
}
.main-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
.main-header h1 {
font-size: 1.75rem;
font-weight: 600;
line-height: 1.25;
}
#media (max-width: 550px) {
.main-header h1 {
margin-bottom: 1rem;
}
}
.search {
position: relative;
display: flex;
align-items: center;
width: 100%;
max-width: 340px;
}
.search input {
font: inherit;
color: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1em 0 36px;
height: 40px;
border-radius: 8px;
border: 2px solid var(--c-border-primary);
color: var(--c-text-action);
font-size: 0.875rem;
transition: 0.15s ease;
width: 100%;
line-height: 1;
}
.search input::-moz-placeholder {
color: var(--c-text-action);
}
.search input:-ms-input-placeholder {
color: var(--c-text-action);
}
.search input::placeholder {
color: var(--c-text-action);
}
.search input:focus, .search input:hover {
border-color: var(--c-accent-primary);
}
.search button {
display: inline-flex;
align-items: center;
justify-content: center;
border: 0;
background-color: transparent;
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
font-size: 1.25em;
color: var(--c-text-action);
padding: 0;
height: 40px;
}
.horizontal-tabs {
margin-top: 1.5rem;
display: flex;
align-items: center;
overflow-x: auto;
}
#media (max-width: 1000px) {
.horizontal-tabs {
scrollbar-width: none;
position: relative;
}
.horizontal-tabs::-webkit-scrollbar {
display: none;
}
}
.horizontal-tabs a {
display: inline-flex;
flex-shrink: 0;
align-items: center;
height: 48px;
padding: 0 0.25rem;
font-weight: 500;
color: inherit;
border-bottom: 3px solid transparent;
text-decoration: none;
transition: 0.15s ease;
}
.horizontal-tabs a:hover, .horizontal-tabs a:focus, .horizontal-tabs a.active {
color: var(--c-accent-primary);
border-bottom-color: var(--c-accent-primary);
}
.horizontal-tabs a + * {
margin-left: 1rem;
}
.content-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
padding-top: 3rem;
margin-top: -1px;
border-top: 1px solid var(--c-border-primary);
}
.content-header-intro h2 {
font-size: 1.25rem;
font-weight: 600;
}
.content-header-intro p {
color: var(--c-text-secondary);
margin-top: 0.25rem;
font-size: 0.875rem;
margin-bottom: 1rem;
}
#media (min-width: 800px) {
.content-header-actions a:first-child {
display: none;
}
}
.content {
border-top: 1px solid var(--c-border-primary);
margin-top: 2rem;
display: flex;
align-items: flex-start;
}
.content-panel {
display: none;
max-width: 280px;
width: 25%;
padding: 2rem 1rem 2rem 0;
margin-right: 3rem;
}
#media (min-width: 800px) {
.content-panel {
display: block;
}
}
.vertical-tabs {
display: flex;
flex-direction: column;
}
.vertical-tabs a {
display: flex;
align-items: center;
padding: 0.75em 1em;
background-color: transparent;
border-radius: 8px;
text-decoration: none;
font-weight: 500;
color: var(--c-text-action);
transition: 0.15s ease;
}
.vertical-tabs a:hover, .vertical-tabs a:focus, .vertical-tabs a.active {
background-color: var(--c-background-tertiary);
color: var(--c-accent-primary);
}
.vertical-tabs a + * {
margin-top: 0.25rem;
}
.content-main {
padding-top: 2rem;
padding-bottom: 6rem;
flex-grow: 1;
}
.card-grid {
display: grid;
grid-template-columns: repeat(1, 1fr);
-moz-column-gap: 1.5rem;
column-gap: 1.5rem;
row-gap: 1.5rem;
}
#media (min-width: 600px) {
.card-grid {
grid-template-columns: repeat(2, 1fr);
}
}
#media (min-width: 1200px) {
.card-grid {
grid-template-columns: repeat(3, 1fr);
}
}
.card {
background-color: var(--c-background-primary);
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.05);
border-radius: 8px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.card-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 1.5rem 1.25rem 1rem 1.25rem;
}
.card-header div {
display: flex;
align-items: center;
}
.card-header div span {
width: 40px;
height: 40px;
border-radius: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.card-header div span img {
max-height: 100%;
}
.card-header div h3 {
margin-left: 0.75rem;
font-weight: 500;
}
.toggle span {
display: block;
width: 40px;
height: 24px;
border-radius: 99em;
background-color: var(--c-background-quaternary);
box-shadow: inset 1px 1px 1px 0 rgba(0, 0, 0, 0.05);
position: relative;
transition: 0.15s ease;
}
.toggle span:before {
content: "";
display: block;
position: absolute;
left: 3px;
top: 3px;
height: 18px;
width: 18px;
background-color: var(--c-background-primary);
border-radius: 50%;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
transition: 0.15s ease;
}
.toggle input {
clip: rect(0 0 0 0);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.toggle input:checked + span {
background-color: var(--c-accent-primary);
}
.toggle input:checked + span:before {
transform: translateX(calc(100% - 2px));
}
.toggle input:focus + span {
box-shadow: 0 0 0 4px var(--c-background-tertiary);
}
.card-body {
padding: 1rem 1.25rem;
font-size: 0.875rem;
}
.card-footer {
margin-top: auto;
padding: 1rem 1.25rem;
display: flex;
align-items: center;
justify-content: flex-end;
border-top: 1px solid rgba(0,0,0,.125);
}
.card-footer a {
color: var(--c-text-action);
text-decoration: none;
font-weight: 500;
font-size: 0.875rem;
}
html::-webkit-scrollbar {
width: 12px;
}
html::-webkit-scrollbar-thumb {
background-color: var(--c-text-primary);
border: 4px solid var(--c-background-primary);
border-radius: 99em;
}
You are using Bootstrap 5, yet you did not linked it in the head:
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
Then change the structure of your Navbar:
<!---Navbar--->
<header>
<div class="navbar navbar-expand-md">
<div class="container">
Logo Here
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainmenu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainmenu">
<ul class="navbar-nav ms-auto">
<li class="nav-item">Home</li>
<li class="nav-item">Page</li>
<li class="nav-item dropdown">
Dropdown
<ul class="dropdown-menu">
<li>Dropdown 01</li>
<li>Dropdown 02</li>
</ul>
</li>
<li class="nav-item">Contact</li>
</ul>
</div>
</div>
</div>
</header>
<!---Navbar--->
And finally, remove the custom CSS you made in your CSS file. Eventually, in the css file, search for Nav and delete everything related to the navbar

Removing some of Bootstrap CSS styling [duplicate]

This question already has answers here:
How to remove/disable styling on some bootstrap elements
(5 answers)
Removing bootstrap styling from certain elements
(1 answer)
How do you completely remove a style from bootstrap by overriding it
(2 answers)
How can I remove a Bootstrap CSS styling for a specific element?
(1 answer)
How can I override Bootstrap CSS styles?
(14 answers)
Closed 5 months ago.
I added the Bootstrap styling link in my page head, but it adds some extra styling to my cards that I don't want. How can I remove it without deleting the Bootstrap CSS link?
I have provided a screenshot and my code below.
How I want to keep it
How it looks when BS CSS link gets added
function switchTabs() {
document.querySelectorAll(".tab-button").forEach(link => {
link.addEventListener("click", () => {
const menuBar = link.parentElement;
const tabsContainer = menuBar.parentElement;
const tabNumber = link.dataset.forTab;
const tabToActivate = tabsContainer.querySelector(`[data-tab="${tabNumber}"]`)
menuBar.querySelectorAll(".tab-button").forEach(link => {
link.classList.remove("tab-button-active");
})
tabsContainer.querySelectorAll(".content").forEach(tab => {
tab.classList.remove("content-active");
})
link.classList.add("tab-button-active");
tabToActivate.classList.add("content-active");
});
});
}
document.addEventListener("DOMContentLoaded", () => {
switchTabs();
document.querySelectorAll(".content").forEach(tabsContainer => {
document.querySelector(".horizontal-tabs .tab-button").click()
})
});
function menuToggle() {
const toggleMenu = document.querySelector(".menu");
toggleMenu.classList.toggle("active");
}
#import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro: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");
:root {
--c-text-primary: #282a32;
--c-text-secondary: #686b87;
--c-text-action: #404089;
--c-accent-primary: #434ce8;
--c-border-primary: #eff1f6;
--c-background-primary: #ffffff;
--c-background-secondary: #fdfcff;
--c-background-tertiary: #ecf3fe;
--c-background-quaternary: #e9ecf4;
}
body {
line-height: 1.5;
min-height: 100vh;
font-family: "Be Vietnam Pro", sans-serif;
background-color: #E5E5E5 !important;
color: var(--c-text-primary);
}
:focus {
outline: 0;
}
.navbar-light {
background-color: #ffffff;
}
.navbar-nav {
justify-content: space-between;
}
.navbar-brand {
font-size: 45px;
color: #A388E7 !important;
font-weight: bolder;
padding-top: 0.3125rem;
padding-bottom: 0.3125rem;
margin-right: 1rem;
text-decoration: none;
white-space: nowrap;
}
.nav-item {
color: #686868 !important;
font-size: 20px;
position: relative;
right: -1675px !important;
}
.nav-item a {
display: block;
padding: 0.5rem 1rem;
color: #000000;
text-decoration: none;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
#alert {
position: relative;
right: -3px !important;
}
.action {
position: fixed;
top: 20px;
right: 30px;
}
.action .profile {
position: relative;
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
cursor: pointer;
}
.action .profile img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.action .menu {
position: absolute;
top: 120px;
right: -10px;
padding: 10px 20px;
background: #fff;
width: 200px;
box-sizing: 0 5px 25px rgba(0, 0, 0, 0.1);
border-radius: 15px;
transition: 0.5s;
visibility: hidden;
opacity: 0;
}
.action .menu.active {
top: 80px;
visibility: visible;
opacity: 1;
}
.action .menu::before {
content: "";
position: absolute;
top: -5px;
right: 28px;
width: 20px;
height: 20px;
background: #fff;
transform: rotate(45deg);
}
*,
::after,
::before {
box-sizing: border-box;
}
.action .menu h3 {
width: 100%;
text-align: center;
font-size: 18px;
padding: 20px 0;
font-weight: 500;
color: #555;
line-height: 1.5em;
}
.action .menu h3 span {
font-size: 14px;
color: #cecece;
font-weight: 300;
}
.action .menu ul li {
list-style: none;
padding: 16px 0;
border-top: 1px solid rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
}
.action .menu ul li img {
max-width: 20px;
margin-right: 10px;
opacity: 0.5;
transition: 0.5s;
}
.action .menu ul li:hover img {
opacity: 1;
}
.action .menu ul li a {
display: inline-block;
text-decoration: none;
color: #555;
font-weight: 500;
transition: 0.5s;
}
.action .menu ul li:hover a {
color: #9370DB;
}
.responsive-wrapper {
width: 90%;
max-width: 1280px;
margin-left: auto;
margin-right: auto;
}
.button {
font: inherit;
color: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1em;
height: 40px;
border-radius: 8px;
line-height: 1;
border: 2px solid var(--c-border-primary);
color: var(--c-text-action);
font-size: 0.875rem;
transition: 0.15s ease;
background-color: var(--c-background-primary);
}
.button i {
margin-right: 0.5rem;
font-size: 1.25em;
}
.button span {
font-weight: 500;
}
.button:hover,
.button:focus {
border-color: var(--c-accent-primary);
color: var(--c-accent-primary);
}
.main {
padding-top: 3rem;
}
.main-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
.main-header h1 {
font-size: 1.75rem;
font-weight: 600;
line-height: 1.25;
}
#media (max-width: 550px) {
.main-header h1 {
margin-bottom: 1rem;
}
}
.search {
position: relative;
display: flex;
align-items: center;
width: 100%;
max-width: 340px;
}
.search input {
font: inherit;
color: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1em 0 36px;
height: 40px;
border-radius: 8px;
border: 2px solid var(--c-border-primary);
color: var(--c-text-action);
font-size: 0.875rem;
transition: 0.15s ease;
width: 100%;
line-height: 1;
}
.search input::-moz-placeholder {
color: var(--c-text-action);
}
.search input:-ms-input-placeholder {
color: var(--c-text-action);
}
.search input::placeholder {
color: var(--c-text-action);
}
.search input:focus,
.search input:hover {
border-color: var(--c-accent-primary);
}
.search button {
display: inline-flex;
align-items: center;
justify-content: center;
border: 0;
background-color: transparent;
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
font-size: 1.25em;
color: var(--c-text-action);
padding: 0;
height: 40px;
}
.horizontal-tabs {
margin-top: 1.5rem;
display: flex;
align-items: center;
overflow-x: auto;
}
#media (max-width: 1000px) {
.horizontal-tabs {
scrollbar-width: none;
position: relative;
}
.horizontal-tabs::-webkit-scrollbar {
display: none;
}
}
.horizontal-tabs a {
display: inline-flex;
flex-shrink: 0;
align-items: center;
height: 48px;
padding: 0 0.25rem;
font-weight: 500;
color: inherit;
border-bottom: 3px solid transparent;
text-decoration: none;
transition: 0.15s ease;
}
.horizontal-tabs a:hover,
.horizontal-tabs a:focus,
.horizontal-tabs a.active {
color: var(--c-accent-primary);
border-bottom-color: var(--c-accent-primary);
}
.horizontal-tabs a+* {
margin-left: 1rem;
}
.content-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
padding-top: 3rem;
margin-top: -1px;
border-top: 1px solid var(--c-border-primary);
width: 100%;
}
.content-header-intro h2 {
font-size: 1.25rem;
font-weight: 600;
}
.content-header-intro p {
color: var(--c-text-secondary);
margin-top: 0.25rem;
font-size: 0.875rem;
margin-bottom: 1rem;
}
#media (min-width: 800px) {
.content-header-actions a:first-child {
display: none;
}
}
.content {
border-top: 1px solid var(--c-border-primary);
margin-top: 2rem;
display: none;
flex-direction: column;
}
.content-active {
display: flex !important;
}
.content-panel {
display: none;
max-width: 280px;
width: 25%;
padding: 2rem 1rem 2rem 0;
margin-right: 3rem;
}
.content-main-wrapper {
width: 100%;
display: flex;
flex-direction: row;
}
#media (min-width: 800px) {
.content-panel {
display: block;
}
}
.vertical-tabs {
display: flex;
flex-direction: column;
}
.vertical-tabs a {
display: flex;
align-items: center;
padding: 0.75em 1em;
background-color: transparent;
border-radius: 8px;
text-decoration: none;
font-weight: 500;
color: var(--c-text-action);
transition: 0.15s ease;
}
.vertical-tabs a:hover,
.vertical-tabs a:focus,
.vertical-tabs a.active {
background-color: var(--c-background-tertiary);
color: var(--c-accent-primary);
}
.vertical-tabs a+* {
margin-top: 0.25rem;
}
.content-main {
padding-top: 2rem;
padding-bottom: 6rem;
flex-grow: 1;
}
.card-grid {
display: grid;
grid-template-columns: repeat(1, 1fr);
-moz-column-gap: 1.5rem;
column-gap: 1.5rem;
row-gap: 1.5rem;
}
#media (min-width: 600px) {
.card-grid {
grid-template-columns: repeat(2, 1fr);
}
}
#media (min-width: 1200px) {
.card-grid {
grid-template-columns: repeat(3, 1fr);
}
}
.card {
background-color: var(--c-background-primary);
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.05);
border-radius: 8px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.card-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 1.5rem 1.25rem 1rem 1.25rem;
}
.card-header div {
display: flex;
align-items: center;
}
.card-header div span {
width: 40px;
height: 40px;
border-radius: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.card-header div span img {
max-height: 100%;
}
.card-header div h3 {
margin-left: 0.75rem;
font-weight: 500;
}
/*---Profile---*/
/*---Profile---*/
.toggle span {
display: block;
width: 40px;
height: 24px;
border-radius: 99em;
background-color: var(--c-background-quaternary);
box-shadow: inset 1px 1px 1px 0 rgba(0, 0, 0, 0.05);
position: relative;
transition: 0.15s ease;
}
.toggle span:before {
content: "";
display: block;
position: absolute;
left: 3px;
top: 3px;
height: 18px;
width: 18px;
background-color: var(--c-background-primary);
border-radius: 50%;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
transition: 0.15s ease;
}
.toggle input {
clip: rect(0 0 0 0);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.toggle input:checked+span {
background-color: var(--c-accent-primary);
}
.toggle input:checked+span:before {
transform: translateX(calc(100% - 2px));
}
.toggle input:focus+span {
box-shadow: 0 0 0 4px var(--c-background-tertiary);
}
.card-body {
padding: 1rem 1.25rem;
font-size: 0.875rem;
}
.card-footer {
margin-top: auto;
padding: 1rem 1.25rem;
display: flex;
align-items: center;
justify-content: flex-end;
border-top: 1px solid rgba(0, 0, 0, .125);
}
.card-footer a {
color: var(--c-text-action);
text-decoration: none;
font-weight: 500;
font-size: 0.875rem;
}
.tab-button-active {
color: var(--c-accent-primary) !important;
border-bottom: 3px solid var(--c-accent-primary) !important;
}
html::-webkit-scrollbar {
width: 12px;
}
html::-webkit-scrollbar-thumb {
background-color: var(--c-text-primary);
border: 4px solid var(--c-background-primary);
border-radius: 99em;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>StudioPick</title>
<!---Bootstrap CSS--->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="CSS/settings.css">
</head>
<body>
<!---Navbar--->
<header>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a style="font-size: 45px; color: #A388E7;" class="navbar-brand" href="#"><strong>StudioPick</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-curresnt="page" href="index.html">Home</a>
</li>
<li class="nav-item2">
<div class="action">
<div class="profile" onclick="menuToggle();">
<img src="./assets/avatar.jpg" />
</div>
<div class="menu">
<h3 id="profile-name"><strong>User Name</strong></h3>
<p class="text-muted" id="userType"
style="position: relative; top: -20px; right: -60px; font-size: 12px !important">
Studio</p>
<ul>
<li>
<img src="./assets/icons/user.png" />Dashboard
</li>
<li>
<img src="./assets/icons/edit.png" /><a href="editprofile.html">Edit
profile</a>
</li>
<li>
<img src="./assets/icons/envelope.png" />Inbox
</li>
<li>
<img src="./assets/icons/settings.png" />Setting
</li>
<li><img src="./assets/icons/question.png" />Help</li>
<li>
<img src="./assets/icons/log-out.png" /><a href="#"
onclick="signOut();">Logout</a>
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!---Navbar--->
<main class="main">
<div class="responsive-wrapper">
<div class="main-header">
<h1>Settings</h1>
<div class="search">
<input type="text" placeholder="Search" />
<button type="submit">
<i class="ph-magnifying-glass-bold"></i>
</button>
</div>
</div>
<div class="horizontal-tabs">
<a class="tab-button" href="#" data-for-tab="1">Profile</a>
<a class="tab-button" href="#" data-for-tab="2">My Rooms</a>
<a class="tab-button" href="#" data-for-tab="3">Session Management</a>
<a class="tab-button" href="#" data-for-tab="4">Payment History</a>
<a class="tab-button" href="#" data-for-tab="5">Edit Payment</a>
</div>
<!---Tab 1--->
<div class="content" data-tab="1">
<div class="content-header">
<div class="content-header-intro">
<h2>Manage your profile</h2>
<p>Edit your profile information such email, username, password, etc.</p>
</div>
</div>
<div class="content-main-wrapper">
<div class="content-main">
<h3>Legal Name</h3>
<p class="legalName text-muted">User's Legal Name</p>
</div>
</div>
</div>
<!---Tab 1--->
<!---Tab 2--->
<div class="content" data-tab="2">
<div class="content-header">
<div class="content-header-intro">
<h2>Manage your studio rooms</h2>
<p>Add, delete, and edit the room images for your studio profile.</p>
</div>
<div class="content-header-actions">
<a href="#" class="button">
<i class="ph-faders-bold"></i>
<span>Filters</span>
</a>
<a href="#" class="button">
<i class="ph-plus-bold"></i>
<span>Add a room</span>
</a>
</div>
</div>
<div class="content-main-wrapper">
<div class="content-panel">
<div class="vertical-tabs">
View Rooms
Manage Services
</div>
</div>
<div class="content-main">
<div class="card-grid">
<article class="card">
<div class="card-header">
<div>
<span><img src="https://assets.codepen.io/285131/zeplin.svg" /></span>
<h3>Room A</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Add room's content</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
<article class="card">
<div class="card-header">
<div>
<span><img src="https://assets.codepen.io/285131/github.svg" /></span>
<h3>Room B</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Add room's content</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
<article class="card">
<div class="card-header">
<div>
<span><img src="https://assets.codepen.io/285131/figma.svg" /></span>
<h3>Room C</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Add room's content</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
</div>
</div>
</div>
</div>
<!---Tab 2--->
<!---Tab 3--->
<div class="content" data-tab="3">
<div class="content-panel">
<div class="vertical-tabs">
</div>
</div>
<div class="content-main-wrapper">
<div class="content-main">
<div class="card-grid">
</div>
</div>
</div>
</div>
<!---Tab 3--->
</div>
</main>
<!-- partial -->
<script src='https://unpkg.com/phosphor-icons'></script>
<script src="Javascript/settings.js"></script>
<!----More Bootstrap--->
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.10.2/dist/umd/popper.min.js"
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"></script>
<!----More Bootstrap--->
</body>
</html>
You can add other Bootstrap classes to .card-header which is where the background and border come from.
You can use bg-white for the white background and border-0 for no border.
function switchTabs() {
document.querySelectorAll(".tab-button").forEach(link => {
link.addEventListener("click", () => {
const menuBar = link.parentElement;
const tabsContainer = menuBar.parentElement;
const tabNumber = link.dataset.forTab;
const tabToActivate = tabsContainer.querySelector(`[data-tab="${tabNumber}"]`)
menuBar.querySelectorAll(".tab-button").forEach(link => {
link.classList.remove("tab-button-active");
})
tabsContainer.querySelectorAll(".content").forEach(tab => {
tab.classList.remove("content-active");
})
link.classList.add("tab-button-active");
tabToActivate.classList.add("content-active");
});
});
}
document.addEventListener("DOMContentLoaded", () => {
switchTabs();
document.querySelectorAll(".content").forEach(tabsContainer => {
document.querySelector(".horizontal-tabs .tab-button").click()
})
});
function menuToggle() {
const toggleMenu = document.querySelector(".menu");
toggleMenu.classList.toggle("active");
}
#import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro: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");
:root {
--c-text-primary: #282a32;
--c-text-secondary: #686b87;
--c-text-action: #404089;
--c-accent-primary: #434ce8;
--c-border-primary: #eff1f6;
--c-background-primary: #ffffff;
--c-background-secondary: #fdfcff;
--c-background-tertiary: #ecf3fe;
--c-background-quaternary: #e9ecf4;
}
body {
line-height: 1.5;
min-height: 100vh;
font-family: "Be Vietnam Pro", sans-serif;
background-color: #E5E5E5 !important;
color: var(--c-text-primary);
}
:focus {
outline: 0;
}
.navbar-light {
background-color: #ffffff;
}
.navbar-nav {
justify-content: space-between;
}
.navbar-brand {
font-size: 45px;
color: #A388E7 !important;
font-weight: bolder;
padding-top: 0.3125rem;
padding-bottom: 0.3125rem;
margin-right: 1rem;
text-decoration: none;
white-space: nowrap;
}
.nav-item {
color: #686868 !important;
font-size: 20px;
position: relative;
right: -1675px !important;
}
.nav-item a {
display: block;
padding: 0.5rem 1rem;
color: #000000;
text-decoration: none;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
#alert {
position: relative;
right: -3px !important;
}
.action {
position: fixed;
top: 20px;
right: 30px;
}
.action .profile {
position: relative;
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
cursor: pointer;
}
.action .profile img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.action .menu {
position: absolute;
top: 120px;
right: -10px;
padding: 10px 20px;
background: #fff;
width: 200px;
box-sizing: 0 5px 25px rgba(0, 0, 0, 0.1);
border-radius: 15px;
transition: 0.5s;
visibility: hidden;
opacity: 0;
}
.action .menu.active {
top: 80px;
visibility: visible;
opacity: 1;
}
.action .menu::before {
content: "";
position: absolute;
top: -5px;
right: 28px;
width: 20px;
height: 20px;
background: #fff;
transform: rotate(45deg);
}
*,
::after,
::before {
box-sizing: border-box;
}
.action .menu h3 {
width: 100%;
text-align: center;
font-size: 18px;
padding: 20px 0;
font-weight: 500;
color: #555;
line-height: 1.5em;
}
.action .menu h3 span {
font-size: 14px;
color: #cecece;
font-weight: 300;
}
.action .menu ul li {
list-style: none;
padding: 16px 0;
border-top: 1px solid rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
}
.action .menu ul li img {
max-width: 20px;
margin-right: 10px;
opacity: 0.5;
transition: 0.5s;
}
.action .menu ul li:hover img {
opacity: 1;
}
.action .menu ul li a {
display: inline-block;
text-decoration: none;
color: #555;
font-weight: 500;
transition: 0.5s;
}
.action .menu ul li:hover a {
color: #9370DB;
}
.responsive-wrapper {
width: 90%;
max-width: 1280px;
margin-left: auto;
margin-right: auto;
}
.button {
font: inherit;
color: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1em;
height: 40px;
border-radius: 8px;
line-height: 1;
border: 2px solid var(--c-border-primary);
color: var(--c-text-action);
font-size: 0.875rem;
transition: 0.15s ease;
background-color: var(--c-background-primary);
}
.button i {
margin-right: 0.5rem;
font-size: 1.25em;
}
.button span {
font-weight: 500;
}
.button:hover,
.button:focus {
border-color: var(--c-accent-primary);
color: var(--c-accent-primary);
}
.main {
padding-top: 3rem;
}
.main-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
.main-header h1 {
font-size: 1.75rem;
font-weight: 600;
line-height: 1.25;
}
#media (max-width: 550px) {
.main-header h1 {
margin-bottom: 1rem;
}
}
.search {
position: relative;
display: flex;
align-items: center;
width: 100%;
max-width: 340px;
}
.search input {
font: inherit;
color: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1em 0 36px;
height: 40px;
border-radius: 8px;
border: 2px solid var(--c-border-primary);
color: var(--c-text-action);
font-size: 0.875rem;
transition: 0.15s ease;
width: 100%;
line-height: 1;
}
.search input::-moz-placeholder {
color: var(--c-text-action);
}
.search input:-ms-input-placeholder {
color: var(--c-text-action);
}
.search input::placeholder {
color: var(--c-text-action);
}
.search input:focus,
.search input:hover {
border-color: var(--c-accent-primary);
}
.search button {
display: inline-flex;
align-items: center;
justify-content: center;
border: 0;
background-color: transparent;
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
font-size: 1.25em;
color: var(--c-text-action);
padding: 0;
height: 40px;
}
.horizontal-tabs {
margin-top: 1.5rem;
display: flex;
align-items: center;
overflow-x: auto;
}
#media (max-width: 1000px) {
.horizontal-tabs {
scrollbar-width: none;
position: relative;
}
.horizontal-tabs::-webkit-scrollbar {
display: none;
}
}
.horizontal-tabs a {
display: inline-flex;
flex-shrink: 0;
align-items: center;
height: 48px;
padding: 0 0.25rem;
font-weight: 500;
color: inherit;
border-bottom: 3px solid transparent;
text-decoration: none;
transition: 0.15s ease;
}
.horizontal-tabs a:hover,
.horizontal-tabs a:focus,
.horizontal-tabs a.active {
color: var(--c-accent-primary);
border-bottom-color: var(--c-accent-primary);
}
.horizontal-tabs a+* {
margin-left: 1rem;
}
.content-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
padding-top: 3rem;
margin-top: -1px;
border-top: 1px solid var(--c-border-primary);
width: 100%;
}
.content-header-intro h2 {
font-size: 1.25rem;
font-weight: 600;
}
.content-header-intro p {
color: var(--c-text-secondary);
margin-top: 0.25rem;
font-size: 0.875rem;
margin-bottom: 1rem;
}
#media (min-width: 800px) {
.content-header-actions a:first-child {
display: none;
}
}
.content {
border-top: 1px solid var(--c-border-primary);
margin-top: 2rem;
display: none;
flex-direction: column;
}
.content-active {
display: flex !important;
}
.content-panel {
display: none;
max-width: 280px;
width: 25%;
padding: 2rem 1rem 2rem 0;
margin-right: 3rem;
}
.content-main-wrapper {
width: 100%;
display: flex;
flex-direction: row;
}
#media (min-width: 800px) {
.content-panel {
display: block;
}
}
.vertical-tabs {
display: flex;
flex-direction: column;
}
.vertical-tabs a {
display: flex;
align-items: center;
padding: 0.75em 1em;
background-color: transparent;
border-radius: 8px;
text-decoration: none;
font-weight: 500;
color: var(--c-text-action);
transition: 0.15s ease;
}
.vertical-tabs a:hover,
.vertical-tabs a:focus,
.vertical-tabs a.active {
background-color: var(--c-background-tertiary);
color: var(--c-accent-primary);
}
.vertical-tabs a+* {
margin-top: 0.25rem;
}
.content-main {
padding-top: 2rem;
padding-bottom: 6rem;
flex-grow: 1;
}
.card-grid {
display: grid;
grid-template-columns: repeat(1, 1fr);
-moz-column-gap: 1.5rem;
column-gap: 1.5rem;
row-gap: 1.5rem;
}
#media (min-width: 600px) {
.card-grid {
grid-template-columns: repeat(2, 1fr);
}
}
#media (min-width: 1200px) {
.card-grid {
grid-template-columns: repeat(3, 1fr);
}
}
.card {
background-color: var(--c-background-primary);
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.05);
border-radius: 8px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.card-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 1.5rem 1.25rem 1rem 1.25rem;
}
.card-header div {
display: flex;
align-items: center;
}
.card-header div span {
width: 40px;
height: 40px;
border-radius: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.card-header div span img {
max-height: 100%;
}
.card-header div h3 {
margin-left: 0.75rem;
font-weight: 500;
}
/*---Profile---*/
/*---Profile---*/
.toggle span {
display: block;
width: 40px;
height: 24px;
border-radius: 99em;
background-color: var(--c-background-quaternary);
box-shadow: inset 1px 1px 1px 0 rgba(0, 0, 0, 0.05);
position: relative;
transition: 0.15s ease;
}
.toggle span:before {
content: "";
display: block;
position: absolute;
left: 3px;
top: 3px;
height: 18px;
width: 18px;
background-color: var(--c-background-primary);
border-radius: 50%;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
transition: 0.15s ease;
}
.toggle input {
clip: rect(0 0 0 0);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.toggle input:checked+span {
background-color: var(--c-accent-primary);
}
.toggle input:checked+span:before {
transform: translateX(calc(100% - 2px));
}
.toggle input:focus+span {
box-shadow: 0 0 0 4px var(--c-background-tertiary);
}
.card-body {
padding: 1rem 1.25rem;
font-size: 0.875rem;
}
.card-footer {
margin-top: auto;
padding: 1rem 1.25rem;
display: flex;
align-items: center;
justify-content: flex-end;
border-top: 1px solid rgba(0, 0, 0, .125);
}
.card-footer a {
color: var(--c-text-action);
text-decoration: none;
font-weight: 500;
font-size: 0.875rem;
}
.tab-button-active {
color: var(--c-accent-primary) !important;
border-bottom: 3px solid var(--c-accent-primary) !important;
}
html::-webkit-scrollbar {
width: 12px;
}
html::-webkit-scrollbar-thumb {
background-color: var(--c-text-primary);
border: 4px solid var(--c-background-primary);
border-radius: 99em;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>StudioPick</title>
<!---Bootstrap CSS--->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="CSS/settings.css">
</head>
<body>
<!---Navbar--->
<header>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a style="font-size: 45px; color: #A388E7;" class="navbar-brand" href="#"><strong>StudioPick</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-curresnt="page" href="index.html">Home</a>
</li>
<li class="nav-item2">
<div class="action">
<div class="profile" onclick="menuToggle();">
<img src="./assets/avatar.jpg" />
</div>
<div class="menu">
<h3 id="profile-name"><strong>User Name</strong></h3>
<p class="text-muted" id="userType" style="position: relative; top: -20px; right: -60px; font-size: 12px !important">
Studio</p>
<ul>
<li>
<img src="./assets/icons/user.png" />Dashboard
</li>
<li>
<img src="./assets/icons/edit.png" /><a href="editprofile.html">Edit
profile</a>
</li>
<li>
<img src="./assets/icons/envelope.png" />Inbox
</li>
<li>
<img src="./assets/icons/settings.png" />Setting
</li>
<li><img src="./assets/icons/question.png" />Help</li>
<li>
<img src="./assets/icons/log-out.png" />Logout
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!---Navbar--->
<main class="main">
<div class="responsive-wrapper">
<div class="main-header">
<h1>Settings</h1>
<div class="search">
<input type="text" placeholder="Search" />
<button type="submit">
<i class="ph-magnifying-glass-bold"></i>
</button>
</div>
</div>
<div class="horizontal-tabs">
<a class="tab-button" href="#" data-for-tab="1">Profile</a>
<a class="tab-button" href="#" data-for-tab="2">My Rooms</a>
<a class="tab-button" href="#" data-for-tab="3">Session Management</a>
<a class="tab-button" href="#" data-for-tab="4">Payment History</a>
<a class="tab-button" href="#" data-for-tab="5">Edit Payment</a>
</div>
<!---Tab 1--->
<div class="content" data-tab="1">
<div class="content-header">
<div class="content-header-intro">
<h2>Manage your profile</h2>
<p>Edit your profile information such email, username, password, etc.</p>
</div>
</div>
<div class="content-main-wrapper">
<div class="content-main">
<h3>Legal Name</h3>
<p class="legalName text-muted">User's Legal Name</p>
</div>
</div>
</div>
<!---Tab 1--->
<!---Tab 2--->
<div class="content" data-tab="2">
<div class="content-header">
<div class="content-header-intro">
<h2>Manage your studio rooms</h2>
<p>Add, delete, and edit the room images for your studio profile.</p>
</div>
<div class="content-header-actions">
<a href="#" class="button">
<i class="ph-faders-bold"></i>
<span>Filters</span>
</a>
<a href="#" class="button">
<i class="ph-plus-bold"></i>
<span>Add a room</span>
</a>
</div>
</div>
<div class="content-main-wrapper">
<div class="content-panel">
<div class="vertical-tabs">
View Rooms
Manage Services
</div>
</div>
<div class="content-main">
<div class="card-grid">
<article class="card">
<div class="card-header bg-white border-0">
<div>
<span><img src="https://assets.codepen.io/285131/zeplin.svg" /></span>
<h3>Room A</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Add room's content</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
<article class="card">
<div class="card-header bg-white border-0">
<div>
<span><img src="https://assets.codepen.io/285131/github.svg" /></span>
<h3>Room B</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Add room's content</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
<article class="card">
<div class="card-header bg-white border-0">
<div>
<span><img src="https://assets.codepen.io/285131/figma.svg" /></span>
<h3>Room C</h3>
</div>
<label class="toggle">
<input type="checkbox" checked>
<span></span>
</label>
</div>
<div class="card-body">
<p>Add room's content</p>
</div>
<div class="card-footer">
View integration
</div>
</article>
</div>
</div>
</div>
</div>
<!---Tab 2--->
<!---Tab 3--->
<div class="content" data-tab="3">
<div class="content-panel">
<div class="vertical-tabs">
</div>
</div>
<div class="content-main-wrapper">
<div class="content-main">
<div class="card-grid">
</div>
</div>
</div>
</div>
<!---Tab 3--->
</div>
</main>
<!-- partial -->
<script src='https://unpkg.com/phosphor-icons'></script>
<script src="Javascript/settings.js"></script>
<!----More Bootstrap--->
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
<!----More Bootstrap--->
</body>
</html>
Solution 1
You can override Bootstrap's styles.
.card-header {
background: white;
border: none;
}
in case this doesn't work, consider using !important
Solution 2
If you want to keep .card-header's styles for your application but just want to change it in one place then add a custom class to your .card-header div and style it accordingly.
PS: CSS libraries do not always provide the desired styling or classes you want. So it's best to learn what to do in such cases.

footer does not cover the entirety of the length of the page

This is my first time writing in html and css, so sorry if it's confusing and dumb.
I'm trying to make that sticks to the bottom and covers the length of the page, the problem is that i tried everything i could, from padding to width:100% other thant searching online, what can i do?
I'm using angular and i have installed bootstrap, please don't hesitate to ask any question or to ask me to explain myself (i'm not a native speaker), have a nice day and thank you!
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#300;400;500;600;700&display=swap');
body {
width: 100%;
height: 100%;
line-height: 1;
font-family: 'Poppins', sans-serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 2270px;
margin: 0 auto;
}
.row {
display: flex;
flex-wrap: wrap;
}
ul {
list-style: none;
}
.footer {
background-color: #24262b;
padding: 20px 0;
}
.footer-col {
width: 25%;
padding: 0;
}
.footer-col h4 {
font-size: 18px;
color: #ffffff;
text-transform: capitalize;
margin-bottom: 35px;
font-weight: 500;
position: relative;
}
.footer-col h4::before {
content: '';
position: absolute;
left: 0;
bottom: -10px;
background-color: #e91e63;
height: 2px;
box-sizing: border-box;
width: 50px;
}
.footer-col ul li:not(:last-child) {
margin-bottom: 10px;
}
.footer-col ul li a {
font-size: 16px;
text-transform: capitalize;
color: #ffffff;
text-decoration: none;
font-weight: 300;
color: #bbbbbb;
display: block;
transition: all 0.3s ease;
}
.footer-col ul li a:hover {
color: #ffffff;
padding-left: 8px;
}
.footer-col .social-links a {
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(255, 255, 255, 0.2);
margin: 0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #ffffff;
transition: all 0.5s ease;
}
.footer-col .social-links a:hover {
color: #24262b;
background-color: #ffffff;
}
.siteFooterBar {
position: fixed;
bottom: 0;
padding-top: 10px;
width: 100%;
box-shadow: 0px 0px 25px rgb(207, 207, 207);
height: 78px;
color: #9B9B9B;
background: #F3F3F3;
}
.content {
display: block;
padding: 10px;
margin: 0px auto;
text-align: center;
font: 25px Georgia, "Times New Roman", Times, serif;
font-size: 14px;
width: 300px;
display: flex;
}
.foot {
display: inline;
line-height: 70px;
}
.content img {
height: 150px;
width: 150px;
float: left;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-webkit-transition: all .6s ease-in-out;
transition: 0.6s;
}
.content img:hover {
filter: invert(400%);
filter: brightness(4);
-webkit-filter: grayscale(-100);
-webkit-transform: scale(1.10);
}
/*responsive*/
#media(max-width: 100%) {
.footer-col {
width: 100%;
margin-bottom: 0px;
}
}
#media(max-width: 100%) {
.footer-col {
width: 100%;
}
}
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col">
<div class="content">
<a href="#">
<img src="https://i.imgur.com/1yvwx9I.png">
</a>
</div>
</div>
<div class="footer-col">
<h4>Azienda</h4>
<ul>
<li>Chi Siamo</li>
<li>Contattaci</li>
<li>Placeholder</li>
<li>PlaceHolder</li>
</ul>
</div>
<div class="footer-col">
<h4>Aiuto</h4>
<ul>
<li>FAQ</li>
<li>Consegne</li>
<li>Reso</li>
<li>Informatica privacy</li>
</ul>
</div>
<div class="footer-col">
<h4>Seguici su</h4>
<div class="social-links">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-linkedin-in"></i>
</div>
</div>
</div>
</div>
</footer>
The standard way to align a footer at the bottom of a webpage is just by setting it to position: relative;. However, this entails that there is more content that is equal to or greater than the viewport height. Hence, aligning the footer after the content and at the bottom.
If you don't have content, use position: absolute; on footer. Then you can set bottom: 0px; to get it at the bottom. Then set left and right to 0 to get it the full width. See below.
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#300;400;500;600;700&display=swap');
body {
width: 100%;
height: 100%;
line-height: 1;
font-family: 'Poppins', sans-serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 2270px;
margin: 0 auto;
}
.row {
display: flex;
flex-wrap: wrap;
}
ul {
list-style: none;
}
/* new */
footer {
position: absolute;
bottom: 0px;
right: 0px;
left: 0px;
}
/* end new */
.footer {
background-color: #24262b;
padding: 20px 0;
}
.footer-col {
width: 25%;
padding: 0;
}
.footer-col h4 {
font-size: 18px;
color: #ffffff;
text-transform: capitalize;
margin-bottom: 35px;
font-weight: 500;
position: relative;
}
.footer-col h4::before {
content: '';
position: absolute;
left: 0;
bottom: -10px;
background-color: #e91e63;
height: 2px;
box-sizing: border-box;
width: 50px;
}
.footer-col ul li:not(:last-child) {
margin-bottom: 10px;
}
.footer-col ul li a {
font-size: 16px;
text-transform: capitalize;
color: #ffffff;
text-decoration: none;
font-weight: 300;
color: #bbbbbb;
display: block;
transition: all 0.3s ease;
}
.footer-col ul li a:hover {
color: #ffffff;
padding-left: 8px;
}
.footer-col .social-links a {
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(255, 255, 255, 0.2);
margin: 0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #ffffff;
transition: all 0.5s ease;
}
.footer-col .social-links a:hover {
color: #24262b;
background-color: #ffffff;
}
.siteFooterBar {
position: fixed;
bottom: 0;
padding-top: 10px;
width: 100%;
box-shadow: 0px 0px 25px rgb(207, 207, 207);
height: 78px;
color: #9B9B9B;
background: #F3F3F3;
}
.content {
display: block;
padding: 10px;
margin: 0px auto;
text-align: center;
font: 25px Georgia, "Times New Roman", Times, serif;
font-size: 14px;
width: 300px;
display: flex;
}
.foot {
display: inline;
line-height: 70px;
}
.content img {
height: 150px;
width: 150px;
float: left;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-webkit-transition: all .6s ease-in-out;
transition: 0.6s;
}
.content img:hover {
filter: invert(400%);
filter: brightness(4);
-webkit-filter: grayscale(-100);
-webkit-transform: scale(1.10);
}
/*responsive*/
#media(max-width: 100%) {
.footer-col {
width: 100%;
margin-bottom: 0px;
}
}
#media(max-width: 100%) {
.footer-col {
width: 100%;
}
}
<main>
fooo
</main>
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col">
<div class="content">
<a href="#">
<img src="https://i.imgur.com/1yvwx9I.png">
</a>
</div>
</div>
<div class="footer-col">
<h4>Azienda</h4>
<ul>
<li>Chi Siamo</li>
<li>Contattaci</li>
<li>Placeholder</li>
<li>PlaceHolder</li>
</ul>
</div>
<div class="footer-col">
<h4>Aiuto</h4>
<ul>
<li>FAQ</li>
<li>Consegne</li>
<li>Reso</li>
<li>Informatica privacy</li>
</ul>
</div>
<div class="footer-col">
<h4>Seguici su</h4>
<div class="social-links">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-linkedin-in"></i>
</div>
</div>
</div>
</div>
</footer>

Why are my div elements not growing properly?

I tried to put the elements of social networks together and when I hover the mouse over each element it grows to a size of 200 pixels. I wrote all the code, but when the mouse is placed on the element, the element does not grow properly and looks like an ellipse. Is there anyone who can help me with this?
<style>
:root {
--color-orange: #ff6600;
--color-green: #22d122;
--color-cyan: #33ffff;
--color-magenta: #f33192;
--color-white: #ffffff;
--color-blue: #166fd4;
--color-magenta-dark:#831a4e;
--color-gray:#d6d6d6;
--color-red:#ff0000;
--color-graydark:#333;
--color-blue-dark:#103d68;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Nunito", sans-serif;
}
.wrapper {
display: grid;
grid-template-columns: repeat(4, auto);
place-content: center;
width: 100%;
height: 100vh;
background-color: var(--color-gray);
}
.button {
display: inline-block;
background-color: var(--color-white);
width: 60px;
height: 60px;
overflow: hidden;
box-shadow: 0 10px 10px rgba(0,0,0,0.1);
transition: all 0.3s ease-out;
border-radius: 50%;
margin: 0 5px;
cursor: pointer;
}
.button:hover {
width: 200px;
}
.button .icon {
display: inline-block;
text-align: center;
font-size: 20px;
border-radius: 50%;
height: 60px;
width: 60px;
line-height: 60px;
transition: all 0.3s ease-out;
}
.button:hover .icon i {
color: var(--color-white);
}
.button:nth-child(1):hover .icon {
background-color: var(--color-blue-dark);
}
.button:nth-child(2):hover .icon {
background-color: var(--color-blue);
}
.button:nth-child(3):hover .icon {
background-color: var(--color-magenta);
}
.button:nth-child(4):hover .icon {
background-color: var(--color-red);
}
.button span {
font-size: 20px;
font-weight: bold;
margin-left: 10px;
}
.button:nth-child(1) span {
color: var(--color-blue-dark);
}
.button:nth-child(2) span {
color: var(--color-blue);
}
.button:nth-child(3) span {
color: var(--color-magenta);
}
.button:nth-child(4) span {
color: var(--color-red);
}
</style>
<div class="wrapper">
<div class="button">
<div class="icon">
<i class="fab fa-facebook-f"></i>
</div>
<span>Facebook</span>
</div>
<div class="button">
<div class="icon">
<i class="fab fa-twitter"></i>
</div>
<span>Twitter</span>
</div>
<div class="button">
<div class="icon">
<i class="fab fa-instagram"></i>
</div>
<span>Instagram</span>
</div>
<div class="button">
<div class="icon">
<i class="fab fa-youtube"></i>
</div>
<span>Youtube</span>
</div>
</div>
Change the value of your border-radius on .button:hover
:root {
--color-orange: #ff6600;
--color-green: #22d122;
--color-cyan: #33ffff;
--color-magenta: #f33192;
--color-white: #ffffff;
--color-blue: #166fd4;
--color-magenta-dark: #831a4e;
--color-gray: #d6d6d6;
--color-red: #ff0000;
--color-graydark: #333;
--color-blue-dark: #103d68;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Nunito", sans-serif;
}
.wrapper {
display: grid;
grid-template-columns: repeat(4, auto);
place-content: center;
width: 100%;
height: 100vh;
background-color: var(--color-gray);
}
.button {
display: inline-block;
background-color: var(--color-white);
width: 60px;
height: 60px;
overflow: hidden;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-out;
border-radius: 50%;
margin: 0 5px;
cursor: pointer;
}
.button:hover {
width: 200px;
border-radius: 50px;
}
.button .icon {
display: inline-block;
text-align: center;
font-size: 20px;
border-radius: 50%;
height: 60px;
width: 60px;
line-height: 60px;
transition: all 0.3s ease-out;
}
.button:hover .icon i {
color: var(--color-white);
}
.button:nth-child(1):hover .icon {
background-color: var(--color-blue-dark);
}
.button:nth-child(2):hover .icon {
background-color: var(--color-blue);
}
.button:nth-child(3):hover .icon {
background-color: var(--color-magenta);
}
.button:nth-child(4):hover .icon {
background-color: var(--color-red);
}
.button span {
font-size: 20px;
font-weight: bold;
margin-left: 10px;
}
.button:nth-child(1) span {
color: var(--color-blue-dark);
}
.button:nth-child(2) span {
color: var(--color-blue);
}
.button:nth-child(3) span {
color: var(--color-magenta);
}
.button:nth-child(4) span {
color: var(--color-red);
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css">
<div class="wrapper">
<div class="button">
<div class="icon">
<i class="fab fa-facebook-f"></i>
</div>
<span>Facebook</span>
</div>
<div class="button">
<div class="icon">
<i class="fab fa-twitter"></i>
</div>
<span>Twitter</span>
</div>
<div class="button">
<div class="icon">
<i class="fab fa-instagram"></i>
</div>
<span>Instagram</span>
</div>
<div class="button">
<div class="icon">
<i class="fab fa-youtube"></i>
</div>
<span>Youtube</span>
</div>
</div>
You also need to change height on hover.
.button:hover {
width: 200px;
height: 200px;
border-radius: 50px;
}
But I recommend you to use transform: scale(2) if you aiming for performance.
when you hover the button its height increases and the width
.button:hover{
transform:scale(1.015deg)
}