Class 43 | Working with CSS Frameworks

Working with CSS Frameworks

CSS frameworks are pre-designed libraries of CSS code that provide ready-made solutions for styling and layout. They are designed to make web development faster and more efficient by providing a set of predefined classes that can be used to style elements on a webpage. This class will examine three popular CSS frameworks: Bootstrap, Foundation, and Materialize.

Bootstrap

Bootstrap is a popular CSS framework that Twitter developed. It provides a set of predefined CSS classes and JavaScript components that make it easy to create responsive websites. Bootstrap uses a 12-column grid system that makes it easy to create responsive layouts. Here’s an example of how to create a simple Bootstrap page:

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap Example</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  </head>
  <body>
    <div class="container">
      <h1>Hello, world!</h1>
      <p>This is a simple Bootstrap example.</p>
    </div>
  </body>
</html>

We’ve included the Bootstrap CSS and JavaScript files using CDN links in this example. We’ve also included a container class, which centers the page’s content and applies responsive padding.

Foundation

Foundation is another popular CSS framework that Zurb developed. It provides a set of predefined CSS classes and JavaScript components that make it easy to create responsive websites. The foundation uses a 12-column grid system that makes it easy to create responsive layouts. Here’s an example of how to create a simple Foundation page:

<!DOCTYPE html>
<html>
  <head>
    <title>Foundation Example</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/js/foundation.min.js"></script>
  </head>
  <body>
    <div class="grid-container">
      <div class="grid-x">
        <div class="cell">
          <h1>Hello, world!</h1>
          <p>This is a simple Foundation example.</p>
        </div>
      </div>
    </div>
  </body>
</html>

We’ve included the Foundation CSS and JavaScript files using CDN links in this example. We’ve also used the grid-container and grid-x classes to create a responsive grid layout.

See also  Class - 03 | HTML Document Structure | HTML Tutorial

Materialize

Materialize is a CSS framework based on Google’s Material Design language. It provides a set of predefined CSS classes and JavaScript components that make it easy to create responsive websites. Materialize uses a 12-column grid system that makes it easy to create responsive layouts. Here’s an example of how to create a simple Materialize page:

<!DOCTYPE html>
<html>
  <head>
    <title>Materialize Example</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdnjs

Hamza Raja

Website Developer, Blogger, Digital Marketer & Search Engine Optimization SEO Expert.

Leave a Comment