Building a Blog Layout
A blog layout is one of the most commonly built page types on the web. It combines a prominent featured post area, a main article feed, and a sidebar into a single cohesive page. Building one from scratch with HTML and CSS is an excellent way to practice real-world layout skills.
The Two-Column Content Area
Many classic blog layouts feature a two-column structure. This typically uses a wide main column for the article feed and a narrower aside column for widgets like a tag cloud or recent posts. CSS grid is perfect for this:
Inside this grid you place a main tag for the article feed and an aside tag for the sidebar. For mobile devices, a media query can be used to reset the grid to a single column so the sidebar stacks neatly below the articles.
The Featured Post Banner
Most successful blogs highlight their best article prominently above the article feed in a large hero-style banner. This is typically a full-width div or a section with a gradient background, large heading text, and a single "Read Article" button.
The Sidebar
A sidebar is built from a collection of "widgets". These are self-contained blocks each covering a different topic (like a tag cloud, recent posts, or newsletter signup). Widgets are typically represented as separate div elements inside the aside tag, each given a border and padding to visually separate them.
The Footer
A blog footer is an important part of the layout that sits below all the main content. It provides a natural end to the page and gives users a second chance to explore other parts of the site without scrolling all the way back to the top.
Blog footers are usually divided into multiple columns using CSS grid, and typically contain:
- Brand column: The blog name and a short description. This reinforces identity and helps new readers understand what the blog is about.
- Category links: Direct links to the most popular topic areas on the site.
- Site links: Secondary navigation such as About, Contact, Privacy Policy, and Newsletter pages.
- Copyright bar: A thin strip at the very bottom with the copyright year and legal notice.
Here's an example of the CSS for a three-column footer:
Full Working Example
Below is a fully styled blog layout featuring a sticky header, a featured post banner, an article card feed, a sidebar with widgets, and a multi-column footer. Resize the window to see the sidebar stack below the articles on narrow screens: