I'm using Bootstrap.
I need to achieve this result :
For that I started doing this :
<body>
<div id="diagonal-bg"></div>
</body>
#diagonal-bg{
position: absolute;
left: -800px;
width: 200%;
min-height: 700px;
background-image: -webkit-linear-gradient(118deg, #fff 35%, #8aa8ec 35%);
}
It works almost because as soon as I resize my window here is what I get :
How can I have distances A and B to be always the same across different size of screen/window, to make it responsive.
Thanks
I've resolved my issue :
<div class="background">
<div class="top"></div>
<div class="bottom"></div>
</div>
.background {
position: absolute;
width: 100%;
margin: 0 auto;
}
.top {
height: 100px;
background-color: #23d6c5;
}
.bottom {
width: 100%;
height: 500px;
background: linear-gradient(to right bottom, #2f3441 50%, transparent 50%);
}
body{
background-color: white;
}
.background {
position: absolute;
width: 100%;
margin: 0 auto;
}
.top {
height: 100px;
background-color: #2f3441;
}
.bottom {
width: 100%;
height: 500px;
background: linear-gradient(to right bottom, #2f3441 50%, transparent 50%);
}
<div class="background">
<div class="top"></div>
<div class="bottom"></div>
</div>