wolf
wolf

Reputation: 186

Firefox CSS issue.Flex items overflowing.How to make flex items shrink?

enter image description here

My component is getting hidden only in firefox browser.I assume this is a CSS issue.I have pasted an image from firefox console.Please explain what is this "lock" symbol and why half of my component is not appearing .

The flex items are getting hidden because they are overflowing.I tried using flex-wrap but this caused the text to appear in 2 rows.Can i make flex items shrink?

element {
}
.abcs.results .side {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    background-color: #f3f4f5;
    border-left: 2px solid #cdcfd1;
    padding: 15px;
    width: 310px;
}
.abcs.results .side {
    display: none;
}
* {
    margin: 0;
    padding: 0;
}
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
body {
    font-family: abcs_default;
    font-weight: 400;
    color: #5a5b5c;
    font-size: 14px;
}
body {
    line-height: 1.42857143;
    color: #333;
}
html {
    font-family: sans-serif;
    -webkit-text-size-adjust: 100%;

Upvotes: 1

Views: 432

Answers (2)

wolf
wolf

Reputation: 186

I was able to fix this by adding min-width:0 to my component.

Upvotes: 2

Rounin
Rounin

Reputation: 29453

Can i make flex items shrink?

Yes.

The shorthand property flex is a concise way of writing out the following properties:

  • flex-grow
  • flex-shrink
  • flex-basis

eg.

flex: 1 1 100px;

gives a (nominally 100px wide) flex-child-element a flex shrink factor of 1.

This means, when there isn’t enough space in the row, the flex-child-element will shrink at a factor of 1 relative to the rest of the flex items in the flex-parent-element.


Further Reading:

Upvotes: 1

Related Questions