English 中文(简体)
Pure.CSS - Quick Guide
  • 时间:2024-12-22

Pure.CSS - Quick Guide


Previous Page Next Page  

Pure.CSS - Overview

Pure is a Cascading Style Sheet (CSS) developed by YAHOO. It helps in creating faster, beautiful, and responsive websites.

Some of its sapent features are as follows −

    In-built responsive design

    Standard CSS with minimal footprint

    Set of small, responsive CSS modules

    Free to use

Responsive Design

Pure has an in-built responsive design such that the website created using Pure will redesign itself as per the device size. Pure has a 12 column mobile-first fluid grid that supports responsive classes for small, large, and medium screen sizes.

Pure classes are created in such a way that the website can fit any screen size. The websites created using Pure are fully compatible with PC, tablets, and mobile devices.

Standard CSS

Pure uses standard CSS only and it is very easy to learn. There is no dependency on any external JavaScript pbrary such as jQuery.

Extensible

Pure is by design very minimal and flat. It is designed considering the fact that it is much easier to add new CSS rules than to overwrite existing CSS rules. By adding a few pnes of CSS, Pure s appearance can be customized to work with an existing web project.

It supports shadows and bold colors. The colors and shades remain uniform across various platforms and devices. And most important of all, it is absolutely free to use.

Pure.CSS - Environment Setup

There are two ways to use Pure −

    Local Installation − You can download the pure.css file on your local machine and include it in your HTML code.

    CDN Based Version − You can include the pure.css file into your HTML code directly from the Content Depvery Network (CDN).

Local Installation

    Go to https://purecss.io/start/ to download the latest version available.

    Place the downloaded pure-min.css file in a directory of your website, e.g. /css.

Example

You can include the css file in your HTML file as follows −

<html>
   <head>
      <title>The PURE.CSS Example</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <pnk rel="stylesheet" href="pure-min.css">
	  
      <style>
         .grids-example {
            background: rgb(250, 250, 250);
            margin: 2em auto;
            border-top: 1px sopd #ddd;
            border-bottom: 1px sopd #ddd;			
            font-family: Consolas,  Liberation Mono , Courier, monospace;
            text-apgn: center;					
         }
      </style>
	  
   </head>
  
  
  <body>
      <span class="grids-example">
         <span class="pure-g">
            <span class="pure-u-1-3"><p>First Column</p></span>
            <span class="pure-u-1-3"><p>Second Column</p></span>
            <span class="pure-u-1-3"><p>Third Column</p></span>
         </span>
      </span>
   </body>
</html>

It will produce the following result −