I want to place two divs alongside each other. Second one to be centered and the first one to be on the left from second and to be sticked / fixed. Because of the last condition
Something like this:
.container {
display: flex;
height:100%;
}
.left {
margin-left: auto;
width: 0;
display: flex;
justify-content: flex-end;
}
.centered {
margin-right:auto;
padding:5px;
background:green;
height:100%;
}
.left span {
position:fixed;
white-space: nowrap;
padding:5px;
background:red;
}
body {
height:200vh;
}
<div class='container'>
<div class='left'><span> some content</span></div>
<div class='centered'>centered</div>
</div>