Flex layout Syntax and Practice

Source: Internet
Author: User

Reference documents

Nanyi The syntax of the flex layout

Nanyi Flex Layout Practice

What is Flex syntax Flex

Flex is the abbreviation for flexible box, meaning "resilient layout", which provides maximum flexibility for box-shaped models. Any container can be specified as a flex layout, and inline elements can also use the flex layout.

Elements that use flex layouts, called Flex container, are referred to as "containers." All of its child elements automatically become container members, known as Flex items (Flex Item), or "project" for short.

Properties of the Flex container
    • Flex-direction
    • Flex-wrap
    • Flex-flow
    • Justify-content
    • Align-items
    • Align-content
Properties of the Flex project
    • order
    • flex-grow
    • flex-shrink
    • flex-basis
    • flex
    • align-self
Flex Practice

(contains a variety of common layout of the perfect solution, can learn from)

Reference: Nanyi Flex Layout Practice

    • The layout of the dice
    • Grid layout
    • Holy Grail layout: The Grail layout (Holy Grail layouts) refers to one of the most common site layouts. Page from top to bottom, divided into three parts: Head (header), torso (body), tail (footer). The torso is divided horizontally into three columns, from left to right: navigation, main bar, sub-bar.
    • Input box layout: Add a hint to the front of the input box and add a button to the rear
    • Hanging layout: Add a picture bar to the left or right of the main bar
    • Fixed bottom bar: The page content is too small to occupy a screen height, the bottom bar will be raised to the middle of the page. You can use the flex layout so that the bottom bar always appears at the bottom of the page
    • Streaming layout: The number of items per line is fixed and automatically branches.

Finish

Flex layout Syntax and Practice

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.