In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to achieve the grid layout in Bootstrap", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to implement the grid layout in Bootstrap"!
1. Bootstrap grid layout
In the last section, we introduced the grid in Bootstrap. Grid is a key and difficult point in web page layout. Layout is the starting point and foundation of web page design. We must work hard to understand it, or at least understand the content of the tutorial I wrote, because what I write is the most commonly used and basic. Of course, for a web designer who has a certain foundation, I believe these contents can be understood at a glance. Today we will further learn about grid layout.
This section covers some of the features in the elastic box (Flex) of a generic class.
2. Vertical alignment
2.1 Vertical alignment is set in the row tab
You can change the vertical alignment of rows in the container by adding align-items-start, align-items-center and align-items-end to the row tags. The above three tags are top, center, and bottom, respectively. The following is a demonstration code and an effect diagram, in which the css code sets the background color and spacing to make it easy to see the effect.
.row {background-color: rgba (0,0,255,0.178); height: 260px: rgba;} .col {background-color: rgba (101,101,161, 0.842); height: 80px: padding: 30px; 10px;} Vertical alignment presentation
2.2 Vertical alignment is set in the col tab
You can change the vertical alignment of columns in rows by adding align-self-start, align-self-center, and align-self-end to the col tags, which are top, center, and bottom, respectively. The following is a demonstration code and an effect diagram, in which the css code sets the background color and spacing to make it easy to see the effect.
.row {background-color: rgba (0,0,255,0.178); height: 260px: rgba;} .col {background-color: rgba (101,101,161, 0.842); height: 80px: padding: 30px; 10px;} Vertical alignment presentation
3. Horizontal alignment
3.1 Vertical alignment is set in the row tab
You can change the horizontal alignment of columns in rows by adding justify-content-start, justify-content-center, justify-content-end, justify-content-around, justify-content-between, and justify-content-evenly to the row tag. The following is a demonstration code and an effect diagram, in which the css code sets the background color and spacing to make it easy to see the effect.
.row {background-color: rgba (0,0,255,0.178); height: 120pxscape margin 10px;} .col-4 {background-color: rgba (101,101,161, 0.842); height: 30pxposition padding: 10pxposition margin: 10px } Vertical alignment demonstration # #
At this point, I believe you have a deeper understanding of "how to achieve the grid layout in Bootstrap". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.