{"id":21263,"date":"2013-04-19T08:40:20","date_gmt":"2013-04-19T15:40:20","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=21263"},"modified":"2022-09-30T08:34:01","modified_gmt":"2022-09-30T15:34:01","slug":"flex-basis","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/f\/flex-basis\/","title":{"rendered":"flex-basis"},"content":{"rendered":"\n

The flex-basis<\/code> property is a sub-property of the Flexible Box Layout module<\/a>. It specifies the initial size of the flex item, before any available space is distributed according to the flex factors. When omitted from the flex<\/code> shorthand, its specified value is the length zero.<\/p>\n\n\n\n

.element {\n  flex-basis: 100px;\n}<\/code><\/pre>\n\n\n\n

A flex-basis value set to auto<\/code> sizes the element according to its size property (which can itself be the keyword auto<\/code>, which sizes the element based on its contents).<\/p>\n\n\n

Syntax<\/h3>\n\n\n
flex-basis: <number><\/code><\/pre>\n\n\n\n

Please note that as for any width, negative lengths are invalid.<\/p>\n\n\n

Demo<\/h3>\n\n\n