JavaScript Tutorial

CSS Website Layout

A common website layout is generally divided into a header, section, navigation bar, and footer. We will take a closer look to each one of the following:-

 

Header Panel

  • The header typically appears at the top of the webpage and contains branding elements, a site title or logo, and possibly a site-wide navigation menu.
  • Use HTML tags like <header> or <div> to wrap the header content.
  • Apply CSS styling to customize the header's appearance, such as setting the background color, adding padding or margins, and adjusting the typography.

Input:-

 

Output:-

 

 

Navigation Bar

  • The navigation bar, also known as the menu, helps users navigate different sections or pages of the website.
  • Use HTML tags like <nav> and <ul> to create the navigation structure, with each menu item represented by an <li> element.
  • Apply CSS styles to format the navigation bar, such as setting its position, background color, and typography, and adding hover effects or dropdown menus.

Input:-

 

Output:-

 

Section

  • Sections are used to divide the main content area of the webpage into distinct parts, such as introductory text, featured products, or different sections of an article.
  • Use HTML tags like <section> to create sections and organize the content within them.
  • Apply CSS styles to control the section's layout, background, spacing, and other visual aspects.

Input:-

 

Output:-

Output(Mobile view):-

 

Footer Panel

  • The footer appears at the bottom of the webpage and often contains information such as copyright notices, contact details, links to terms of service, and social media icons.
  • Use HTML tags like <footer> or <div> to wrap the footer content.
  • Apply CSS styles to customize the footer's appearance, including background color, text alignment, padding, and adding separators or columns if necessary.

Input:-

 

Output:-

This layout structure with a header, section, navigation bar, and footer is one of the most common and widely used website layouts. It provides a clear organization of content and allows users to navigate the website easily.

While this structure forms the foundation of many websites, it's important to note that there are countless other layout designs and variations available. Different websites may require unique layouts based on their specific goals, content, and design aesthetics.

Go back to Previous Course