How To Divide Div Into 3 Equal Columns Layout CSS - Dev Practical
Có thể bạn quan tâm

Dividing a webpage into 3 columns creates more space to present content especially on desktop and wide screen.
3 columns Layout HTML CSS Code
HTML
<div class="columns"> <div class="column"> Column 1 </div> <div class="column"> Column 2 </div> <div class="column"> Column 3 </div> </div>CSS
.column { float: left; width: 33.33%; } /* Stops the float property from affecting content after the columns */ .columns:after { content: ""; display: table; clear: both; }Results

To make it responsive, we are going to use media queries an mobile first approach
.column { width: 100%; } @media (min-width: 48em) { .column { float: left; width: 33.33%; } /* Stops the float property from affecting content after the columns */ .columns:after { content: ""; display: table; clear: both; } }Advertisement
For full width Layout
Just put them in a container and add some padding.
<div class="container"> <div class=" columns"> ///Put your individual columns inside here /// </div> </divCSS
.container { padding: 2em 4em; }Boxed Layout
For boxed Layout put the columns in a container with a maximum width.
HTML
<div class="container"> <div class=" columns"> ///Put your individual columns inside here /// </div> </div>CSS
.container { max-width: 1000px; margin-right: auto; margin-left:auto; }Result
3 Equal Columns Layout Website Examples
Example 1: Ethicalads Three columns
Example 2: Grammarly - Three columns
Example 3: Copy.ai - Three columns
[Screenshot with caption of with details like: boxed or full width] [Links: 1. For full length screenshot. 2. For link to website page]
Browser support for 3 columns CSS Float and Media Queries
- Browser support for CSS Float
- Browser support for CSS Media queries
Từ khóa » Html Div Tag 3 Columns
-
How To Create A Three Column Layout - W3Schools
-
3 Column Layout HTML/CSS - Stack Overflow
-
HTML 3 Column Layout: A Comprehensive And Easy How-To Guide
-
How To Create A 3-column Layout Grid With CSS? - Studytonight
-
How To Create A 3-column Layout Grid With CSS? - Tutorialspoint
-
Grid System - Bootstrap
-
CSS · Bootstrap
-
Divide 3 Divs In 3 Columns - HTML CSS CSS Layout
-
How To Create 3 Columns Oin Html Without Css?
-
CSS Layout Techniques | Comm244 Notes
-
How To Create Columns In HTML
-
Basic Concepts Of Grid Layout - CSS: Cascading Style Sheets | MDN
-
How To Create A Responsive 3 Column Layout Using Html And CSS ...
-
3 Column Layouts (Responsive Demos & Example HTML/CSS)