Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering CSS

You're reading from   Mastering CSS A guided journey through modern CSS

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781787281585
Length 522 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Rich Finelli Rich Finelli
Author Profile Icon Rich Finelli
Rich Finelli
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. CSS Foundations 2. Ramping Up FREE CHAPTER 3. Creating a Page Layout with Floats 4. Creating Buttons with Modular, Reusable CSS Classes, and CSS3 5. Creating the Main Navigation and Drop-Down Menu 6. Becoming Responsive 7. Web Fonts 8. Workflow for HiDPI Devices 9. Flexbox, Part 1 10. Flexbox, Part 2 11. Wrapping Up

Creating a multicolumn layout

Floats were designed to flow text around an image. However, floats are also the most common way of building a multicolumn layout. In this section, we'll look at how to float elements next to each other in order to create a page layout.

So, what we currently have in the HTML in the secondary section are three div tags with a class of column:

The following screenshot illustrates the final site. This is what we're aiming for. We want three equal columns with a small gutter or margin in between:

In our current site, columns are stacked on top of one another. Right now, we have simple rows, so we want to fix that using floats. In our final site, we want to have everything centered in the middle of the page, but right now, all of our content goes from one edge of the browser window to pretty much the opposite edge of the browser window:

Let...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime