How to use CSS flexible box model flex in layout

WJ
Release: 2020-05-30 13:08:45
forward
2530 people have browsed it

How to use CSS flexible box model flex in layout

Application of CSS flexible box model flex in layout

Element centering

【1】Use main-axis alignment justify-content and cross-axis alignment align-items on the scalable container

 
DEMO
Copy after login

【2】Use margin:auto

 
DEMO
Copy after login

## on the scalable item #Align both ends

 
DEMO
DEMO
DEMO
DEMO
Copy after login

Align bottom

 
DEMO
DEMO
DEMO
DEMO
Copy after login

Input box button

 
Copy after login

etc. Sub-layout

 
1
2
3
4
Copy after login

Multi-column adaptive layout

 

left

left

center

center

right

right

Copy after login

Hanging layout

 
左侧悬挂
主要内容主要内容主要内容主要内容主要内容主要内容主要内容主要内容主要内容主要内容主要内容主要内容主要内容
Copy after login

Full screen layout

 

top

left

right

bottom

Copy after login
The above is the entire application of CSS flexible box model flex in layout.

Related references:

php中文网

##

The above is the detailed content of How to use CSS flexible box model flex in layout. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:51dev.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!