Layout in HTML

Websites often display content in the form of columns (like in newspapers or magazines). HTML5 brings new grammatical elements to define and different parts of the site:

  1. define document title or section (section)
  2. The set definition contains navigation paths
  3. define a part in the document
  4. define an independent, self-contained article in itself
  5. define content next to another content (like sidebar)
  6. Footer definition for text or part
  7. Detailed definition added
  8. Title definition for element

Layout in HTML Picture 1
How to display on the page of the above elements

HTML page layout technique

There are four ways to create multiple columns in HTML, each with its own strengths and weaknesses.

  1. HTML table
  2. Floating properties of CSS
  3. Framework CSS
  4. Flexbox CSS

Which way should I choose to create multiple column layouts in HTML?

Use tables in HTML

Element which is not used for page layout. Its purpose is to display data in tabular form. So do not use the table to create a layout for the page because it will make the code very messy. Imagine a few months later going back to editing the page design and how difficult it would be.

Framework CSS

If you want to create a fast layout, you can use frameworks like Bootstrap .

Floating characteristic (float) of CSS

Designing the entire layout of the site with floating properties (float) in CSS is very common. Float is easy to learn - just remember how it works. But this also has the disadvantage that it attaches to the flow of documents, which can affect the flexibility of the page. Below is an example of CSS floating properties.









TipsMake.com






Technology


The TipsMake.com Technology category will include tips, instructions for using software, hardware, fixing network errors, and fixing computer errors on many operating systems such as Windows, macOS, Linux, Android, iOS, etc. .


Keep up to date with the latest tips and tricks to troubleshoot your readers.




Copyright © TipsMake.com




Layout in HTML Picture 2
Results display page with the floating properties of CSS

Flexbox CSS

Flexbox is the new layout mode in CSS3.

Using flexbox ensures that the elements work as expected when the page layout must adapt to different screen sizes and devices. But this way has a disadvantage of not working on IE10 and earlier versions.

This is an example of creating a page layout with flexbox.








TipsMake.com






Technology


The TipsMake.com Technology category will include tips, instructions for using software, hardware, fixing network errors, and fixing computer errors on many operating systems such as Windows, macOS, Linux, Android, iOS, etc. .


Keep up to date with the latest tips and tricks to troubleshoot your readers.




Copyright © TipsMake.com




When resizing an open HTML page, you'll see the page layout change:

Layout in HTML Picture 3

Layout in HTML Picture 4
Page layout with flexbox

Previous article: Head element in HTML

Lesson: Designing websites running on multiple devices (responsive web) in HTML

4 ★ | 1 Vote

May be interested

  • Text in HTMLText in HTML
    the element in html is used to define a paragraph of text.
  • How to Use Text Color Tags in HTMLHow to Use Text Color Tags in HTML
    this article explains how to change the font color in html documents. although the html style tag is obsolete in html5, you can use css to color content on an html page. if you use an older version of html, you can use the html text color tag as needed.
  • Format text in HTMLFormat text in HTML
    format elements in html help determine the style and importance of text.
  • Elements in HTMLElements in HTML
    the html element usually goes in pairs, including the opening tag, closing tag, and the content inside the two tags.
  • Symbol - Icon in HTMLSymbol - Icon in HTML
    html has many mathematical, technical and monetary symbols that cannot be used to write.
  • Common HTML mistakes that you should avoid for better web programmingCommon HTML mistakes that you should avoid for better web programming
    learning html is not difficult, but when running it in the browser, errors often occur. here are common html errors and how to handle them for better web development.
  • How to insert spaces in HTMLHow to insert spaces in HTML
    this tutorial explains how to insert spaces and line breaks in html. because no matter how many times you type a space, html will display a space so to insert more than one space, you will need to use the html tag.
  • Image img in HTMLImage img in HTML
    when you visit the website, you will often see images of all sizes and positions on the page. images in html web pages will help to enrich the content as well as increase the aesthetics of the page.
  • Attributes in HTMLAttributes in HTML
    properties are used to add information to elements in html.
  • The id attribute in HTMLThe id attribute in HTML
    in html, the id attribute is used to specify a unique id for an html element (the value must be unique in the html file).