flex shrink 0 causes scrollbar to disappear and it ignores overflow auto in fire fox edge and ie but not in...
up vote
0
down vote
favorite
This question already has an answer here:
Flexbox column-reverse in Firefox, Edge and IE
3 answers
This code is designed to show the numbers in column reverse order from 1 to 4 so I suddenly realize I did not like how display flex was setting the .numbers height and it was ignoring my height in 200px in the numbers class name so I added
flex-shrink: 0;
and it prevented display flex from setting it's own height and it suddenly showed the .numbers original height so I was happy :)
so this is how it looks in Chrome
but sadly flex-shrink: 0 gave strange results in Edge, IE and Fire fox I notice in those browsers it removed the scrollbar and it ignored the overflow-y: auto; mentioned in the #numbers-container.
How can I get it to work like the chrome browser in those other browsers that it did not work in ? :(
Code
#container{
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#numbers-container{
background-color: orange;
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers{
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1{
text-align: center;
color: white;
}
<div id='container'>
<div id='numbers-container'>
<div class='numbers'>
<h1>1</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>2</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>3</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>4</h1>
</div><!--</numbers>-->
</div><!--</numbers-container>-->
</div><!--</container>-->
css css3 flexbox
marked as duplicate by Michael_B
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 8 at 3:44
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
This question already has an answer here:
Flexbox column-reverse in Firefox, Edge and IE
3 answers
This code is designed to show the numbers in column reverse order from 1 to 4 so I suddenly realize I did not like how display flex was setting the .numbers height and it was ignoring my height in 200px in the numbers class name so I added
flex-shrink: 0;
and it prevented display flex from setting it's own height and it suddenly showed the .numbers original height so I was happy :)
so this is how it looks in Chrome
but sadly flex-shrink: 0 gave strange results in Edge, IE and Fire fox I notice in those browsers it removed the scrollbar and it ignored the overflow-y: auto; mentioned in the #numbers-container.
How can I get it to work like the chrome browser in those other browsers that it did not work in ? :(
Code
#container{
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#numbers-container{
background-color: orange;
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers{
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1{
text-align: center;
color: white;
}
<div id='container'>
<div id='numbers-container'>
<div class='numbers'>
<h1>1</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>2</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>3</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>4</h1>
</div><!--</numbers>-->
</div><!--</numbers-container>-->
</div><!--</container>-->
css css3 flexbox
marked as duplicate by Michael_B
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 8 at 3:44
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
different browsers look atflex
very differently. See known issues here. caniuse.com/#search=flex
– Stender
Nov 7 at 10:34
If you want cross-browsers workaround - the community made some here : github.com/philipwalton/flexbugs
– Stender
Nov 7 at 10:35
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
Flexbox column-reverse in Firefox, Edge and IE
3 answers
This code is designed to show the numbers in column reverse order from 1 to 4 so I suddenly realize I did not like how display flex was setting the .numbers height and it was ignoring my height in 200px in the numbers class name so I added
flex-shrink: 0;
and it prevented display flex from setting it's own height and it suddenly showed the .numbers original height so I was happy :)
so this is how it looks in Chrome
but sadly flex-shrink: 0 gave strange results in Edge, IE and Fire fox I notice in those browsers it removed the scrollbar and it ignored the overflow-y: auto; mentioned in the #numbers-container.
How can I get it to work like the chrome browser in those other browsers that it did not work in ? :(
Code
#container{
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#numbers-container{
background-color: orange;
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers{
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1{
text-align: center;
color: white;
}
<div id='container'>
<div id='numbers-container'>
<div class='numbers'>
<h1>1</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>2</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>3</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>4</h1>
</div><!--</numbers>-->
</div><!--</numbers-container>-->
</div><!--</container>-->
css css3 flexbox
This question already has an answer here:
Flexbox column-reverse in Firefox, Edge and IE
3 answers
This code is designed to show the numbers in column reverse order from 1 to 4 so I suddenly realize I did not like how display flex was setting the .numbers height and it was ignoring my height in 200px in the numbers class name so I added
flex-shrink: 0;
and it prevented display flex from setting it's own height and it suddenly showed the .numbers original height so I was happy :)
so this is how it looks in Chrome
but sadly flex-shrink: 0 gave strange results in Edge, IE and Fire fox I notice in those browsers it removed the scrollbar and it ignored the overflow-y: auto; mentioned in the #numbers-container.
How can I get it to work like the chrome browser in those other browsers that it did not work in ? :(
Code
#container{
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#numbers-container{
background-color: orange;
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers{
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1{
text-align: center;
color: white;
}
<div id='container'>
<div id='numbers-container'>
<div class='numbers'>
<h1>1</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>2</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>3</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>4</h1>
</div><!--</numbers>-->
</div><!--</numbers-container>-->
</div><!--</container>-->
This question already has an answer here:
Flexbox column-reverse in Firefox, Edge and IE
3 answers
#container{
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#numbers-container{
background-color: orange;
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers{
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1{
text-align: center;
color: white;
}
<div id='container'>
<div id='numbers-container'>
<div class='numbers'>
<h1>1</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>2</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>3</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>4</h1>
</div><!--</numbers>-->
</div><!--</numbers-container>-->
</div><!--</container>-->
#container{
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#numbers-container{
background-color: orange;
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers{
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1{
text-align: center;
color: white;
}
<div id='container'>
<div id='numbers-container'>
<div class='numbers'>
<h1>1</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>2</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>3</h1>
</div><!--</numbers>-->
<div class='numbers'>
<h1>4</h1>
</div><!--</numbers>-->
</div><!--</numbers-container>-->
</div><!--</container>-->
css css3 flexbox
css css3 flexbox
edited Nov 7 at 19:05
Temani Afif
59.7k93472
59.7k93472
asked Nov 7 at 10:24
Danny Lee
1889
1889
marked as duplicate by Michael_B
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 8 at 3:44
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Michael_B
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 8 at 3:44
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
different browsers look atflex
very differently. See known issues here. caniuse.com/#search=flex
– Stender
Nov 7 at 10:34
If you want cross-browsers workaround - the community made some here : github.com/philipwalton/flexbugs
– Stender
Nov 7 at 10:35
add a comment |
different browsers look atflex
very differently. See known issues here. caniuse.com/#search=flex
– Stender
Nov 7 at 10:34
If you want cross-browsers workaround - the community made some here : github.com/philipwalton/flexbugs
– Stender
Nov 7 at 10:35
different browsers look at
flex
very differently. See known issues here. caniuse.com/#search=flex– Stender
Nov 7 at 10:34
different browsers look at
flex
very differently. See known issues here. caniuse.com/#search=flex– Stender
Nov 7 at 10:34
If you want cross-browsers workaround - the community made some here : github.com/philipwalton/flexbugs
– Stender
Nov 7 at 10:35
If you want cross-browsers workaround - the community made some here : github.com/philipwalton/flexbugs
– Stender
Nov 7 at 10:35
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You could move the scrolling onto it's own container:
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
However, if you want to start your scroll from the bottom, you would probably need to use js
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You could move the scrolling onto it's own container:
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
However, if you want to start your scroll from the bottom, you would probably need to use js
add a comment |
up vote
0
down vote
You could move the scrolling onto it's own container:
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
However, if you want to start your scroll from the bottom, you would probably need to use js
add a comment |
up vote
0
down vote
up vote
0
down vote
You could move the scrolling onto it's own container:
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
However, if you want to start your scroll from the bottom, you would probably need to use js
You could move the scrolling onto it's own container:
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
However, if you want to start your scroll from the bottom, you would probably need to use js
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
/* CSS used here will be applied after bootstrap.css */
#container {
background-color: #d6b68d;
height: 500px;
width: 500px;
border-radius: 8px;
position: relative;
}
#scroll {
height: 90%;
width: 90%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
overflow-y: auto;
}
#numbers-container {
background-color: orange;
overflow-x: hidden;
display: flex;
flex-direction: column-reverse;
}
.numbers {
background-color: forestgreen;
display: block;
height: 200px;
width: 100%;
position: relative;
border: 2px solid white;
flex-shrink: 0;
}
.numbers h1 {
text-align: center;
color: white;
}
<div id="container">
<div id="scroll">
<div id="numbers-container">
<div class="numbers">
<h1>1</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>2</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>3</h1>
</div>
<!--</numbers>-->
<div class="numbers">
<h1>4</h1>
</div>
<!--</numbers>-->
</div>
<!--</numbers-container>-->
</div>
<!--</scroll-container>-->
</div>
<!--</container>-->
edited Nov 7 at 10:46
answered Nov 7 at 10:41
Pete
39.5k1875115
39.5k1875115
add a comment |
add a comment |
different browsers look at
flex
very differently. See known issues here. caniuse.com/#search=flex– Stender
Nov 7 at 10:34
If you want cross-browsers workaround - the community made some here : github.com/philipwalton/flexbugs
– Stender
Nov 7 at 10:35