Skip to content
infront webworks logo
  • Home
  • Digital Marketing
        • Digital Marketing

        • SEO
          • Enterprise SEO and Digital Marketing
          • Local SEO
          • SEO Audit
          • SEO Consulting
          • SEO Services
          • SEO Tools
          • SEO Workshops
          • Small Business SEO
          • White Label SEO
        • SEM | Search Engine Marketing | PPC
          • Ads & PPC
          • Advertising Management
          • Content Marketing Strategy
          • Conversion Rate Optimization
          • Reputation Management
        • Social Media Marketing
          • Facebook
          • Instagram
          • LinkedIn
          • Pinterest
          • Twitter
        • Need A Website or Seo Help?

          Request a Quote or (719) 577-4404

  • Websites
        • Websites

        • Web Development
          • Business Websites
          • Custom Web Applications
          • Small Business Websites
          • Sitefinity CMS
          • Website Costs
          • Website Evaluation
          • WordPress
        • Web Design
          • Ecommerce
          • Mobile First Web Design
          • Site Speed Optimization
        • Cloud Services
          • Domain Registration
          • Web Hosting
          • Website SSL Certified
        • Need A Website or Seo Help?

          Request a Quote or (719) 577-4404

  • About
        • About

        • The Team
        • Why Infront Webworks
        • Jobs
          • SEO Jobs
          • Website Development Jobs
        • Need A Website or Seo Help?

          Request a Quote or (719) 577-4404

  • Case Studies
        • Case Studies

        • SEARCH ENGINE OPTIMIZATION CASE STUDIES
          • Assisted Living SEO
          • Attorney & Law SEO
          • Automotive SEO
          • Criminal Attorney SEO
          • Dentist SEO
          • E-Commerce SEO​
          • Employment/Staffing SEO
          • Finance SEO
          • Hospitality SEO
          • Home Services SEO
          • Manufacturing SEO
          • Medical & Health Care SEO​
          • Non-Profit SEO​
          • Retail SEO
          • Real Estate SEO
          • Religious SEO
          • Travel and Leisure SEO
        • Web Development Case Studies
          • Small Business Web Design
          • Medium Business Web Design
          • WordPress Web Design
          • Church Web Design
          • Large Business Web Design
          • Nonprofit Web Design
        • Need A Website or Seo Help?

          Request a Quote or (719) 577-4404

  • Blog
  • Contact
        • Contact

        • Support
        • Need A Website or Seo Help?

          Request a Quote or (719) 577-4404

        • Sitemap
Request a Quote or (719) 577-4404
Request a Quote or (719) 577-4404

Home > Blog > Web Design > Dreaded Floaters – Cleaning up your CSS

Dreaded Floaters – Cleaning up your CSS

  • July 30, 2020
  • 8:05 am
  • By: Matthew Palis
Dreaded Floaters - CSS driven layout and the quest to clean up the mess
Dreaded Floaters - CSS driven layout and the quest to clean up the mess

Dreaded floaters – Or, a tale of css driven layout and the quest to clean up the mess.

Gone are the days of the clunky floaters…

and by floaters, I mean CSS float properties to run your layouts. For too long we were subject to layout oddities, browser support issues, float clearing, column height inconsistencies etc.

CSS3

CSS3 has brought to the table so many improvements and prized among them are the flex and CSS grid properties. For the purposes of this post I will focus on setting up basic layouts with flex or flexbox to rid you of the shackles clearing floats.

The principle is fairly straightforward: as with many html/CSS layouts you start with a containing div to apply the float property to, then from there you will attribute the row or column properties, whether child elements can wrap, how they alight horizontally and vertically (yay!) among other options.

The great part of flex is that has reached browser saturation in terms of support so you know you can count on the layout to behave across the various browsers, operating systems and so on.

Working in flex can be imagined in these simplified categories:

flex container, flex item, and direction. In this fashion you can construct a serious of containers to create rows and/or columns. Even better you can nest these structures as deep as you need to create multi-purpose containers.

The Flex Container (Parent):

Rather than suffer the pitfalls of floating containers, defining heights, clearing the floats, and generally checking and guessing at your positioning, Flex Containers behave in a more predictable, straightforward manner.

The flex container does just what it says and contains its flex children (not weightlifting kids mind you). From here properties such of content justification, wrapping, and alignment can be set to create your rows/columns.

These child elements can be all aligned to the beginning, end, or centered in the flex container, horizontally or vertically. From there you can determine the spacing between each by utilizing justification.

The Flex Items (children):

Your child elements in the flex container can be given even more granular properties to grow or shrink in size to fill out space, change their order, and align differently than the properties of the parent container.

To get down and dirty (or clean in this case) with floats there are myriad sources of documentation available including:

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox

https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Want to generate your flexbox styles quickly and eliminate some guesswork? Check out this fantastic Flexy Boxes tool.

The internet is a wide and winding river. Do not get stuck floating along the edges with your layouts; take your journey on the stable craft of flexbox. Leave the floats to their ideal purpose of position elements in relation to blocks of text.

Matthew Palis President / CEO
Matthew Palis

Matthew is the President of Infront Webworks and is a New England native now calling Colorado Springs home. Matt attended The University of NH where he pursued a BS in Natural Resource Economics & Business Administration. Aside from Infront; Matthew has owned and managed two other online agencies based on the seacoast of New Hampshire and been a key player in multiple technology mergers & acquisitions. When he’s not bathing in technology, online marketing & business; he’s probably spending time with his wife and daughter, boating, skiing the trees, hiking or cooking..he is a foodie for sure!

About the Author

Loading...
Matthew Palis President / CEO
Matthew Palis
President / CEO

Matthew is the President of Infront Webworks and is a New England native now calling Colorado Springs home. Matt attended The University of NH where he pursued a BS in Natural Resource Economics & Business Administration. Aside from Infront; Matthew has owned and managed two other online agencies based on the seacoast of New Hampshire and been a key player in multiple technology mergers & acquisitions. When he’s not bathing in technology, online marketing & business; he’s probably spending time with his wife and daughter, boating, skiing the trees, hiking or cooking..he is a foodie for sure!

Infront Webworks Contact Form

START THE CONVERSATION

Service Interests
This field is hidden when viewing the form
This field is for validation purposes and should be left unchanged.
Talk with a local rep: Boulder SEO | Colorado Springs SEO | Denver SEO | Irvine SEO | Las Vegas SEO | Madison SEO | Tempe SEO

Infront Webworks

5350 Tomah Dr #2800
Colorado Springs, CO 80918


Follow Us

Facebook-f Twitter Instagram Linkedin Youtube Rss

HAVE QUESTIONS OR NEED HELP?

SALES: (719) 577-4404 SUPPORT: (719) 359-5540 BILLING: (719) 577-4404 FAX: (719) 630-7073
Open a Support Ticket
© Infront Webworks 2022

Terms of Service | Privacy Policy | Jobs | Company | The Team | HTML Sitemap | XML Sitemap