How To Create Columns In HTML
Có thể bạn quan tâm
HTML columns are essential for organizing data in a structured manner, facilitating clear comparisons between two or more items. By dividing content into columns, you can enhance readability and streamline information presentation on our web pages. In this answer, we will explore how to create columns in an HTML page.
Defining columns in HTML
An HTML column is defined in the <div> tag using the class = "column" keyword. More columns can be added by adding more divs with the same class. The following syntax is used to add columns in HTML.
- <div class="row"> tag is used to initialize the row where all the columns will be added.
- <div class="column" > tag is used to add the corresponding number of columns.
- style="background-color:#aaa;" property is used to give color to the column.
- Individual properties, such as width: 50%;, are added to the columns in the style sheet for that particular div.
Example
Below is an example of how to create 2 basic columns in HTML.
Multiple columns
HTML also allows the creation of more than two columns in a single row; we can set varying widths for these columns by specifying them in the style sheet.
Relevant Answers
Explore Courses
Free Resources
Copyright ©2024 Educative, Inc. All rights reservedLearn in-demand tech skills in half the time
PRODUCTSMock Interview
NewCourses
Skill Paths
Projects
Assessments
TRENDING TOPICSLearn to Code
Tech Interview Prep
Generative AI
Data Science
Machine Learning
GitHub Students Scholarship
Early Access Courses
Blind 75
Layoffs
PricingFor Individuals
Try for Free
Gift a Subscription
CONTRIBUTEBecome an Author
Become an Affiliate
Earn Referral Credits
RESOURCESBlog
Cheatsheets
Webinars
Answers
ABOUT USOur Team
Careers
HiringFrequently Asked Questions
Contact Us
Press
LEGALPrivacy Policy
Cookie Policy
Terms of Service
Business Terms of Service
Data Processing Agreement
INTERVIEW PREP COURSESGrokking the Modern System Design Interview
Grokking the Product Architecture Design Interview
Grokking the Coding Interview Patterns
Machine Learning System Design
Tiktok Streamline Icon: https://streamlinehq.comCopyright ©2024 Educative, Inc. All rights reserved.
Từ khóa » Html Css Div 2 Column Layout
-
How To Create A Two Column Layout - W3Schools
-
CSS Multiple Columns - W3Schools
-
How To Create A Responsive Two Column Layout In HTML And CSS
-
CSS Multi-column Layout - CSS: Cascading Style Sheets | MDN
-
2 Column Layouts (Responsive Demos & Example HTML/CSS)
-
How To Create A 2-column Layout Grid With CSS? - Tutorialspoint
-
Ridiculously Easy Row And Column Layouts With Flexbox
-
CSS Layout Techniques | Comm244 Notes
-
Grid System - Bootstrap
-
CSS Floating 2 Column Layout With Multiple Elements - Stack Overflow
-
Simple 2 Column CSS Layout | 456 Berea Street
-
How To Build A 2-column Layout Using Flexbox | HTML/CSS - YouTube
-
How To Define Two Column Layout Using Flexbox ? - GeeksforGeeks
-
2-column Layout With Margin In Between