CSS flex-basis attribute of flexibleflex-basis ModelInstance
Set the initial length of the second elastic box element to 80 pixels:
Div: nth-of-type (2) {flex-basis: 80px ;}
Browser support for effect Preview
The number in the t
preview
CSS Syntax flex-basis: Number|auto|initial|inherit; property value
value
Description
number
a unit of length or a percentage that specifies the initial length of a flexible project.
auto
default value. Length equals the length of the flexible item. If the item does not speci
1. Let's take a look at several examples:
(1) width and flex-baiss are not set for each item. The element is displayed in the size of the content in flex.
(2) Only Set width = 100px (implicit flex-basis = auto) for the item01 element, and only set flex_basis = 250px (implicit width = auto) for the item02 elemen
The explanation for Flex-basis on the WebPlatform1 is:
The Flex-basis CSS property describes the initial main size of the flex item before any free spaces is distributed Accordin G to the fle
CSS 3 layout attributes flex and CSS 3 layout flex
The html code is as follows:
The css code is as follows:
. Ul_box {margin: 0; padding: 0; list-style: none;/* display: flex displays the object as an auto scaling box;
The old version of CSS flex is compatible with CSS flex.× Catalog [1] applicability [2] scaling project [3] scaling Flow Direction [4] scaling flow line feed [5] spindle alignment [6] scaling [7] display sequence [8] flex compatibility
The
size of the project.
{ flex-basis: */default Auto */}
It can be set to width height the same value as a property (such as 350px), then the item will occupy a fixed space.4.5 Flex PropertiesflexThe property is flex-grow , flex-shrink and shorthand for,
1. Introduction 1.1 DescriptionThe flex layout, also known as Flex flexible layout, is primarily designed to have the width and height of the item fill the free space of the parent container in a certain order.ExampleNote : In the following section, the parent container is referred to as an item in the container.1.2 Browser support conditionsIE 11 does not fully support the
, the horse and the pony, among them the big horse has been married for many years, has a bunch of twin daughters, the telework, but the Chinese horse and Pony is the outstanding bachelor person. So, the big horse asked to allocate more houses, eventually, family consultations with the following distribution results are:#大马 {House-allocation: 2;} #中马 {House-allocation: 1;} #小马 {House-allocation: 1;}I think the allocation above should be easy to read. The house is divided into a total of 4, of wh
space. Its default value is auto, which is the original size of the project.{ flex-basis: /** /}Note: It can be set to the same value as the width or height property (such as 350px), then the item will occupy a fixed space.5.flexFunction: Shorthand for Flex-grow, Flex-shrink, and
CSS elastic box model flex application in layout, css model flex Layout* Directory [1] element center [2] Two ends alignment [3] Bottom alignment [4] input box button [5] equi layout [6] Adaptive Layout [7] Hanging layout [8] in front of full screen Layout
I have already described in detail the basic syntax and compati
scaling reference value, the expansion ratio, and the shrinkage ratio can all be decimals, but not negative"5" Scalability: an abbreviation for the expansion ratio, shrinkage ratio, and scaling reference valueFlex:none = Flex:0 0Auto; Flex:auto= Flex:1 1Auto; Flex:0= Flex:0 1 0%;
is not valid for this property.ImgA negative value is not valid for this property.4.4 Flex-basis PropertiesThe Flex-basis property defines the spindle space (main size) that the item occupies before allocating the extra space. Based on this property, the browser calculates whether the spindle has extra space. Its defa
This article mainly introduces the CSS Flex flexible layout of the relevant information, small series feel very good, and now share to everyone, but also to make a reference. Let's take a look at it with a little knitting.
Case Base Layout
Html
Css
. box{ Display:-webkit-flex; Displa
Mobile css/html (box-flex) adaptive, proportional layout, cssbox-flexMobile css/html (box-flex) adaptive and proportional Layout
An Adaptive Layout Method for mobile terminals.
Display:
Tablet
Large Mobile Phone screen
Cell phone screen
This layout is mainly
Box-sizing: border-box;
And
display: box;display: -moz-b
clean up the lower additional spaceEnd scaling project to clean up extra space with bottom baseCenter scaling project is centered on the middle and cleans up the upper and lower spaces on averageBaseline scaling project to clean up additional space based on baselineStretch Telescopic project fills the entire container, default5.box-flexThe Box-flex property can use floating-point numbers to distribute scaling itemsSet the proportions that each scalin
The HTML code is as follows:The CSS code is as follows:. ul_box{margin:0; padding:0; List-style:none; /*display:flex the object as an elastic telescopic box; Flex-flow:flex-direction (determines the arrangement of the elastic sub-elements) and flex-wrap (whether or not to wrap the flex element when it is ou
Display: flex css, displayflexcss
This document introduces the usage and attributes of flex.
This adaptive three-column box
Red, blue, green
Flex: flex-grow flex-shrink flex-
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.