05 Best CSS Frameworks in 2020 - Study24x7
Social learning Network

Welcome Back

Get a free Account today !

or

05 Best CSS Frameworks in 2020

Updated on 07 June 2020
study24x7
HTML and CSS
31 min read 0 views
Updated on 07 June 2020

We round up the best CSS frameworks right now, from the big players to more specialised tools.


Looking for the best CSS framework? This guide is here to help. In this feature, we're going to help you get familiar with some of the most interesting and powerful CSS frameworks available. Some of these are well-known, while others are newer tools that are just starting to pick up steam. Either way, you’ll benefit greatly from getting to know these useful tools.you’ll be fully equipped to build clean, maintainable projects with minimal time investment. However, sometimes you need something a little more specific.


01. Bootstrap 



Let’s start with the most popular framework in the world. While Bootstrap is certainly not exclusively a CSS framework, its most popular features are the CSS-based ones. These include a powerful grid system, badges, buttons, card components, navbars and much more. There are also a whole load of free Bootstrap themes to explore.

Bootstrap’s grid system is a great place to start. The Bootstrap grid has been a valuable commodity since the framework’s first public release in 2011. And no wonder – it’s ridiculously easy to use. Once you’ve included Bootstrap’s CSS, creating a responsive flexbox-based grid that works in all browsers is as simple as this:

<div class="container">
<div class="row">
<div class="col-sm">
Column 1
</div>
<div class="col-sm">
Column 2
</div>
<div class="col-sm">
Column 3
</div>
</div>
</div>

As mentioned, Bootstrap also boasts a comprehensive collection of UI components. Some of those that have been difficult to style in the past are just plug-and-play with a framework like Bootstrap. These include a breadcrumb navigation component, a card component and a pagination component. Here’s the HTML to implement pagination:

<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>


02. Foundation



The Foundation framework, like Bootstrap, has become immensely popular and is known as a more sophisticated framework with some advanced but easy-to-implement CSS components. Foundation is built on Sass so, like Bootstrap, it’s customisable. In addition to that, it also boasts some powerful responsive features that mean making mobile-friendly designs is super-easy.

The responsive table component is one of our favourites:

<table class="responsive-card-table unstriped">
<!-- table rows code goes here... -->
</table>

Also, the vertical timeline is a layout feature you don’t see in many frameworks. This component uses the .timeline class for the container, which then holds multiple .timeline-item elements with an icon and content for each item:

<div class="timeline">
<div class="timeline-item">
<div class="timeline-icon">
<img src="image.svg" alt="Icon">
</div>
<div class="timeline-content">
<p class="timeline-content-date">2019</h2>
<p>Example text for timeline item.</p>
</div>
</div>
<!-- More timeline items here ... -->
</div>

That’s just a small sampling of the many components that make Foundation one of the best CSS frameworks available today.


03. UIkit


 


UIkit is another popular frontend framework and maybe a little under-appreciated in terms of CSS features. In addition to many features similar to those found in other popular frameworks, there are a few useful specialised components.

First of all, if you’re still not very comfortable with flexbox, you can do complex flexbox-based layouts with UIkit using plain HTML. It might seem strange at first to use flexbox syntax in your HTML classes but this saves you from having to know all the quirks about flex wrapping, columns/rows, flex grow and so forth. Here’s an example:

<div class="uk-flex uk-flex-wrap uk-flex-wrap-around">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
<div>Item 5</div>
<div>Item 6</div>
</div>

UIkit includes dozens of components that offer attractive styles out-of-the-box. Many of the features are specialised utility classes, including the following:

  1. .uk-align-left, .uk-align-right and .uk-align-center for aligning or floating elements
  2. .uk-column-1-2 up to .uk-column-1-6 for multi-column, magazine-style text layouts
  3. .uk-radio, .uk-checkbox and similar for attractive form inputs
  4. Various margin and padding utility classes (.uk-margin-top, .uk-padding-small etc.)
  5. Various utility classes to relatively position an element inside a container (.uk-position-top, .uk-position-left etc.)


04. Semantic UI 


Semantic UI has a lot of feature overlaps with other popular frameworks but the way it works (implied by the name) is based on the semantic nature of the class names that are used to build components. In other words, the class names are human friendly.

Take a look, for example, at how you would build a four-column grid:

<div class="ui grid">
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
<div class="four wide column"></div>
</div>

Notice the way the class names communicate exactly what’s built. The CSS doesn’t necessarily have a unique set of styles for each of the classes listed but instead the classes work together. Thus, much like language where words make sense in context, the class names work together to build cohesive, mobile-friendly components.

Here’s another example, which builds a simple data table:

<table class="ui celled table">
<!-- ... rest of the table code here... -->
</table>

This is a great demonstration of how Semantic UI uses class names to describe the component being built. If you’re more accustomed to traditional frameworks like Bootstrap or Foundation, the learning curve on this one might be steeper. But once you get the hang of it, it’s pretty powerful and enjoyable to use.


05. Bulma 



Bulma is another popular CSS framework and its primary feature is the fact that its components are largely dependent on flexbox, making it a truly modern framework. You can think of Bulma is being somewhat like a hybrid of Bootstrap and Semantic UI but without any of the complexity. It uses some of the same principles as Semantic UI with its class names, includes many of the popular components, yet manages to keep things simple – for example, form elements have little to no styles to maintain a cross-browser look. 

The following example demonstrates how a Bulma component can be built and is easy to maintain:

<section class="hero is-dark">
<div class="hero-body">
<div class="container is-fluid">
<h1 class="title is-size-2">Example Heading</h1>
<h2 class="subtitle">Example text goes here</h2>
<p>Some example paragraph text here.</p>
</div>
</div>
</section>

Notice the containing <section> element is given the hero and is-dark classes. This indicates you want a hero banner that uses the default dark theme (one of seven theme colours included with Bulma, all of which can be changed via Sass variables).

Also, notice the is-* classes on the container and primary heading. The is-fluid class enables the container to be fluid on any size screen, centred with margins and with no max-width. Without this value, the max-width of the container changes depending on the size of the viewport. The is-size-2 class defines the size of the heading, with sizes ranging from 1 to 7.

As you can see, Bulma makes it incredibly easy to build mobile-friendly interfaces via readable class names.


Note: Follow our page (https://www.study24x7.com/page/htmlcss) to keep yourself better skills with latest updates on HTML and CSS.

study24x7
Write a comment...