.logout
item will grow twice as quick as .home
item.home {
flex-grow: 1;
}
.logout{
flex-grow: 2;
}
nowrap
is the default value of the property.
The value Specifies that the flexible items will not wrap.
Resource: https://youtu.be/k32voqQhODc?t=1154.container {
display: flex;
justify-content: center;
align-items: center;
}
.flex-container > div {
flex:2;
}
The selector above has class name and tag name, therefore it's more specific than this selector:.search {
flex:4;
}
That's why the second selector has no effect in this example.
With more specific selector, like this:.flex-container .search {
flex:4;
}
the .search item will be twice as wide as the other flex items.flex
value, they will take the same space and will shrink and grow equally.container div {
flex: 1;
}
.flex-item:nth-child(1) {
flex:1;
}
The above flex
property is a shorthand of the following properties:.flex-item:nth-child(2) {
flex-grow:1;
flex-shrink:1;
flex-basis:0;
}
In the example, the first two elements have the same effect