当前位置:网站首页>Invalid flex layout setting width
Invalid flex layout setting width
2022-06-13 08:36:00 【webQiang99】
There is a problem in the project today ,
Part of the page is like this , Because it uses ant design mobile Component library , here
I just used ant In the component library flex Layout , But in ant Component library flex Layout , Not like grid layout , You can define the number of columns per row , Because in ant A row in the component library flex The number of columns in the layout is determined by <Flex.Item> The amount of the , Don't wrap ,
You can see this attribute in the official website component library , So I want to give the width of each child element to the width of the parent element 33.33%, Set to wrap , It should be OK , But after setting up , Found set width It doesn't work , Later, step-by-step debugging was carried out , Found out where the problem is , It is because the child element sets a flex attribute ,flex:1 1,flex The expansion factor leads to width It doesn't work , So I wanted to flex The expansion factor of is set to 0, Is to put flex Set to flex:0 1 It should be OK , After setting, it still doesn't work , So find a solution on Baidu , So I found this article and solved the problem perfectly ,
flex Layout settings width Invalid
Set up flex:0 0 Width to be set ,
I still remember when I was in school , During the interview with Beisen cloud front end , There is a question like this :flex:1 0 Give a width , I forgot the specific width , Then let me talk about the final effect , No answer , Because it is usually used flex Generally, only one attribute is used , Other properties , Rarely used , I usually have problems , I will check Baidu myself , The specific usage of these attributes is rarely remembered , Sometimes I remember and understand , After a long time, I didn't use it very much , I forgot again , Today, I encountered such a problem , I still need to flex I'm looking at the properties .
边栏推荐
- VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
- [pychart pit stepping record] prompt after configuring remote operation, [errno 2] no such file or directory
- Journal d'acquisition du faisceau de fichiers à Elk
- Svg text stroke effect
- 京东商品详情接口,京东详情页接口,宝贝详情页接口,商品属性接口,商品信息查询,商品详细信息接口,h5详情,京东APP详情,京东api接口,京东历史价格数据接口代码对接分享
- SQL injection experiment
- About redis encapsulation tool class using distributed locks
- In order to resist the flood, the soldiers have been fighting for 89 hours. How many days and hours are there in total?
- Sizeof, strlen find character length
- Reverse order and comparison of strings
猜你喜欢
随机推荐
Three methods to make the scroll bar of div automatically scroll to the bottom
1.SolidWorks各模块的学习顺序
In order to resist the flood, the soldiers have been fighting for 89 hours. How many days and hours are there in total?
5、 Constant, variable
JS - print 99 multiplication table of the for cycle case
Notes on MySQL transaction not automatically submitting
Young's matrix to find whether a number exists
Namespace in TS (2)
Four ways to install MySQL in Linux
【leetcode周赛记录】第80场双周赛记录
Format_ String_ Server
Wechat upload picture material interface
Microservice project construction III: automatic code generation
天猫商品详情接口,天猫商品优惠券接口,天猫api接口,天猫价格监控接口,天猫比价接口,品牌维权接口,天猫销量api接口,接口代码可对接数据分析业务,品牌维权,比价业务,行业分析业务接口代码分享
Installing pytorch under Anaconda
Gtk+ programming example on page 115 - simplest progress bar 2 with steps to write GTK program using anjuta
Custom exception class myexception
WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
Maternal and infant supplies wholesale industry uses management software to improve efficiency and realize cost reduction and efficiency increase
How to modify desktop path in win10 system








