Hey there, I'm trying to achieve a specific layout but I'm encountering an issue. Here's the code I've written:
@media only screen and (max-width: 990px) {
.arri-light{
margin-bottom: 20px;
padding: 0px !important;
}
.s-img{
display:none;
}
.b-img{
display:block;
}
}
@media only screen and (min-width: 991px) {
.s-img{
display:block;
}
.b-img{
display:none;
}
}
.but-new {
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
transform:translate(-50%, -50%);
}
.nm-1{
margin-top: -212px;
margin-left: 133px;
border-radius: 2px;
}
.all-bb{
display: block;
width: 100%;
overflow: hidden;
margin-top:22px;
}
.main-img{
background-image: url('https://i.postimg.cc/hGFfjpLM/NEW-2.jpg');
height: 400px;
display: flex;
justify-content: flex-end;
align-items: center;
background-repeat: no-repeat;
max-width: 890px;
overflow: hidden;
}
.b-h2 {
text-align: center !important;
font-family: 'Montserrat', sans-serif !important;
color: #383e40 !important;
font-size: 24px !important;
font-weight: 400 !important;
margin: 0 0 0 0 !important;
padding-top: 13px !important;
text-transform: uppercase !important;
padding-bottom: 10px !important;
}
.con-righ{
color:white;
display: inline-block;
max-width:90%;
background: #000000ab;
padding: 36px;
border-radius: 6px;
}
.con-left{
color:white;
display: inline-block;
max-width:90%;
background: #000000ab;
padding: 36px;
border-radius: 6px;
}
.new-h4 {
color: white;
text-transform: uppercase;
font-family: 'Montserrat', sans-serif;
font-size: 32px;
line-height: 36px;
font-weight: 400;
margin: 0 0 0 0;
}
.con-righ p{
font-size: 17px;
padding-top: 17px;
padding-bottom: 17px;
line-height: 25px;
padding-right: 23px
}
.but-red{
padding: 15px;
border-radius: 5px;
background-color: #ff0000;
color: white !Important;
width: max-content;
font-size: 15px;
text-decoration: unset;
transition: .3s all;
overflow: hidden;
display: block;
text-transform: uppercase;
font-family: 'Montserrat', sans-serif;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<div class="container">
<div class="all-bb">
<div class="arri-light col-sm-12 col-md-4">
<img src="https://i.ibb.co/jH5bTZ6/NEW-1.jpg" class="s-img">
<img src="https://i.ibb.co/gvDsjVt/NEW-1-BIG.jpg" class="b-img">
<a class="but-red but-new" href="#"> My button</a>
</div>
<div class="main-img col-sm-12 col-md-8">
<div class="con-righ">
<h4 class="new-h4">Projects</h4>
<p class="s-img">Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore </p>
<p class="b-img">Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.Lorem ipsum dolor.</p>
<a class="but-red" href="#"> View Projects</a>
</div>
</div></div></div>
I'm facing an issue where these two divs have different heights when the screen size changes. You can see the problem in this image https://i.sstatic.net/leygJ.png. Any ideas on how to fix this discrepancy, especially on small desktop screens?