Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

How can I have a position: fixed; behaviour for a flexbox sized element?

$
0
0

I have a div called .side-el which I would like to have in a position: fixed; behavior, but as soon as I apply position fixed the width alternates from the right one. The right width would be the one set by flexbox. How can I achieve this goal?

.container {  -webkit-align-content: flex-start;  align-content: flex-start;  -webkit-align-items: flex-start;  align-items: flex-start;  display: -webkit-flex;  display: flex;  -webkit-flex-direction: row;  flex-direction: row;  -webkit-flex-wrap: wrap;  flex-wrap: wrap;  -webkit-justify-content: flex-start;  justify-content: flex-start;  * {    box-sizing: border-box;    -webkit-flex-grow: 1;    flex-grow: 1;    -webkit-flex-shrink: 0;    flex-shrink: 0;  }}.main-el {  box-sizing: border-box;  padding:0 2em;  width: 70%;}.side-el {  box-sizing: border-box;  width: 30%;}
<div class="container" style="background-color: blue; height: 100px;"><div class="main-el"><div  style="background-color: red; height: 1000px;">content</div></div><div class="side-el"><div style="background-color: red; height: 100px;">content</div></div></div>

Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>