In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of css3's elastic box model case analysis, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this css3 elastic box model case analysis article. Let's take a look at it.
The 1.box-flex attribute specifies whether the child elements of the box can be scaled.
The parent element must declare the display:box; child element before it can use box-flex.
Syntax: box-flex:value
Example:
.test _ box {display:-moz-box;display:-webkit-box;display:box;width: 800px retention margin: 40px auto;padding: 20px
Background: # f0f3f9;}
.list {padding: 01em; font: bold 36px/200px monaco;text-shadow: 1px 1px # eee;}
.list _ one {- moz-box-flex: 1 shareholder WebkitlyboxFleflex: 1 politics boxFleflex: 1 Backgroundlycolor: yellow;}
.list _ two {- moz-box-flex: 2bot WebkitlyboxFleflex: 2bot BoxFleflex: 2bot backgroundlycolor: # 99CC00;}
.list _ three {- moz-box-flex: 1 shareholder WebkitlyboxFleflex: 1 politics boxFleflex: 1 Backgroundlycolor: paleturquoise;}
Result: picture
You can specify the width of a child element and divide the rest equally.
Example:
.test _ box {display:-moz-box;display:-webkit-box;display: box;width: 800px political margin: 40px auto;padding: 20px
Background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/200px monaco
Text-shadow: 1px 1px # eee;}
.list _ one {- moz-box-flex: 1 shareholder WebkitlyboxFleflex: 1 politics boxFleflex: 1 Bitbackground: # 00CC99;}
.list _ two {- moz-box-flex: 2After WebkitlyboxFleflex: 2politics BoxFleflex: 2Bitbackground: # 99FF00;}
.list _ w300 {width: 300px; background: # CCCCFF}
Result: picture
2.box-orient
It is used to determine whether the orientation of the child element is horizontal or vertical.
Optional value: horizontal | vertical | inline-axis | box-axis | inherit?inline-axis is the default horizonta inline-axis is the same so that the element horizontally vertical
Box-axis is the same so that elements are listed.
Example:
.test _ box {width: 300px; margin: 0 auto;display:-moz-box
Display:-webkit-box;display: box;box-orient:horizontal;padding: 20pxscape background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/120px monaco;?text-shadow: 1px 1px # eee;-webkit-box-flex: 1;}
.one {background: # 99FF00;}
.two {background: # 00CC99}
.three {background:#CCCC00}
Result: as shown in the figure
3.box-direction
Used to determine the order of child elements. Optional values:
Onrmal | revers | inherit onrmal is the default value, arranged in normal order, from left to right
From front to back, revers indicates reversal.
Example:
.test _ box {display:-moz-box;display:-webkit-box;display: box;-moz-box-direction:reverse;-webkit-box-direction:reverse
Box-direction:reverse;width: 300pxdecision margin: 20px auto;padding: 10pxscape background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/150px monaco;text-shadow: 1px 1px # eee;}
.list _ one {- moz-box-flex: 1After WebkitMusboxFleflex: 1BoxFleflex: 1Bitbackground: yellow;}
.list _ two {- moz-box-flex: 2After WebkitlyboxFleflex: 2X BoxFleflex: 2bot background: # 99CC00;}
.three {background: # CCCCFF}
Result: as shown in the figure
4.box-align and box-pack
Determine how the remaining space inside the box is used, and the behavior effect is alignment.
Box-align is space utilization in vertical direction, and box-pack is space utilization in horizontal direction.
Box-align optional parameter: start | end | center | baseline | stretch
The height of the child element is as high as the stretch is the default parent tag. Start indicates bottom edge alignment
End is bottom aligned, center is centered, and baseline baseline is aligned.
Example:
.test _ box {margin: 0 auto;display:-moz-box;display:-webkit-box
Display:-Omurboxash display: box;-moz-box-align:end
-webkit-box-align:end;-Omurf house house; box-align:end
Width: 300pxposition height: 200pxposition padding: 20pxposition background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/120px monaco;text-shadow: 1px 1px # eee;}
.one {background: # 99FF00;}
.two {background: # 00CC99}
.three {background:#CCCC00}
Result: as shown in the figure
Available values for box-pack: start | end | center | justify
Start is the default value, and justify indicates that both ends are aligned.
Example:
.test _ box {margin: 0 auto;display:-moz-box;display:-webkit-box
Display:-Omurboxash display: box;-moz-box-pack:justify
-webkit-box-pack:justify;-OmurboxPack Pack Justice; box-pack:justify
Width: 300pxposition height: 200pxposition padding: 20pxposition background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/120px monaco
Text-shadow: 1px 1px # eee;}
.one {background: # 99FF00;}
.two {background: # 00CC99}
.three {background:#CCCC00}
Result: as shown in the figure
5.box-lines
This is used to determine whether child elements can be displayed on new lines. There are two optional values: single | mutiple
Default value of single, no line wrapping. Mutiple line wrap multi-line display.
Example:
.test _ box {margin: 0 auto;display:-moz-box;display:-webkit-box
Display:-Omurboxash display: box;-moz-box-lines:multiple
-webkit-box-lines:multiple;-o-box-lines:multiple
Box-lines:multiple; width: 300px
Height: 200pxposition padding: 20pxscape background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/120px monaco;text-shadow: 1px 1px # eee;}
.one {background: # 99FF00;}
.two {background: # 00CC99}
.three {background:#CCCC00}
Result: as shown in the figure
6.box-ordinal-group
Change the order of the child elements so that the value is a number, and the smaller the number, the higher the rank.
Example:
.test _ box {display:-moz-box;display:-webkit-box;display: box
Width: 300pxdecision margin: 40px auto;padding: 20pxscape background: # f0f3f9;}
.list {padding: 0 1emmit.font: bold 36px/200px monaco;text-shadow: 1px 1px # eee;}
.list _ one {- moz-box-flex: 1 Mustang WebkitlyboxFlex: 1; box-flex: 1
-moz-box-ordinal-group: 1 veto webkitbox Mustang group: 1 Bitte background: # 99CC00;}
.list _ two {- moz-box-flex: 2Mattel WebkitripboxMFlex: 2PortboxFleflex: 2LiveMozMuoBoxUofur group: 2Mutual WebkitMuobox Mustang group: 2
Box-ordinal-group: 2 background: # CC33CC;}
.three {background: # CCCC00}
This is the end of the article on "case Analysis of the Elastic Box Model of css3". Thank you for reading! I believe you all have a certain understanding of the knowledge of "css3 elastic box model case analysis". If you want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.