Home>Article>Web Front-end> How to use bootstrap for page layout

How to use bootstrap for page layout

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼 Original
2019-07-16 18:03:33 4630browse

How to use bootstrap for page layout

First we need to import the bootstrap css file into the prepared cshtml file, as shown below:

How to use bootstrap for page layout

Then we first Let's take a look at how we usually define a block, as shown in the figure below, declaring the width of the div. But problems arise when the screen resolution changes.

How to use bootstrap for page layout

Related recommendations: "bootstrap Getting Started Tutorial"

Then the fence system is defined for us in bootstrap, as shown in the figure below , just call the style directly.

How to use bootstrap for page layout

If you want to adapt between different devices, use the following style:

How to use bootstrap for page layout

and if If you want to put two columns of content in one row, then split the 12 after the style into 6 as shown below.

How to use bootstrap for page layout

Finally, the content of a row is usually wrapped in the row style, and clearfix is added at the end to clear the floats.

How to use bootstrap for page layout

To sum up, using bootstrap for page layout mainly uses its fence system to determine how many columns are in a row.

The above is the detailed content of How to use bootstrap for page layout. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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