Tutorials
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML Layouts

HTML Layout Example

London

London is the capital of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.

Found on the banks of River Thames, London is a major settlement for more than two millennia, with its history speaking of its founding by the Romans, who had named the city as Londinium.

Try it Yourself

HTML Layout Elements

 

Websites are displaying contents in multiple columns (similar to a magazine or newspaper).

HTML5 has got many new semantic elements which is used to define the different parts of a web page:

HTML5 Semantic Elements
  • <header> - It is used to define a header for a document or a section
  • <nav> - It is used to define a container for navigation links
  • <section> - It is used to define a section in a document
  • <article> - It is used to define an independent self-contained article
  • <aside> - It is used to define content aside from the content (like a sidebar)
  • <footer> - It is used to define a footer for a document or a section
  • <details> - It is used to define additional details
  • <summary> - It is used to define a heading for the <details> element

HTML Layout Technics

 

There are 4 ways for creating multicolumn layouts. Each way consists of its own pros and cons:

Which One to Choose?

 

HTML Tables

The <table> element was not meant to be used as a layout tool! The use of the <table> element is for displaying tabular data. So, you should not use tables for laying out your page ! They will cause a mess into your code. And you canimagine how difficult it would be for redesigning your site after few months.

Tip: NEVER use tables to laying out your page!

CSS Frameworks

 

For creating your layout fast, make use of a framework, like W3.CSS or Bootstrap.

CSS Floats

 

It is a very common practice to construct entire web layouts by using the CSS float property. Learning float is easy - you just need to know the working of float and clear properties . Disadvantages: Floating elements are connected to the document flow, that may harm the existing flexibility. We can study more on float in our chapter of CSS Float and Clear o.

Float Example

London

Situated on the banks of River Seine, it is found at the central place of the Île-de-France region, also known as the région parisienne.

on considering its metropolitan area, it is one of the largest populous city in Europe, having over 12 million inhabitants.


Try it Yourself

CSS Flexbox

 

Flexbox is known as a new layout mode of CSS3.

Using flexbox makes sure that elements will be behaving predictably if the page layout needs to accommodate for different screen sizes and different display devices. Disadvantages: It is not working in IE10 and earlier.

You can study more about flexbox in our chapter regarding CSS Flexbox.

Flexbox Example

City Gallery

London

Situated on the banks of River Seine, it is found at the central place of the Île-de-France region, also known as the région parisienne.

on considering its metropolitan area, it is one of the largest populous city in Europe, having over 12 million inhabitants.

Copyright © ngo.com

Try it Yourself