- Pure.CSS — Overview
- Responsive Design
- Standard CSS
- Extensible
- Pure.CSS — Environment Setup
- Local Installation
- Example
- CDN Based Version
- Example
- Pure.CSS — Responsive Design
- Example
- Result
- Pure.CSS — Grids
- Grid Unit Sizes
- 5 th Based Units
- Result
- 24 th Based Units
- Result
- Pure.CSS — Forms
- Example
- Result
- Pure.CSS — Buttons
- Example
- Standard Buttons
- Links as Buttons
- Primary Button
- Customized button
- Different Sized button
- Result
- Pure.CSS — Tables
- Example
- Tables Demo
- Simple Table
- Bordered Table
- Table with Horizontal Borders
- Stripped Table
- Result
- Pure.CSS — Images
- Example
- Images Demo
- Result
- Pure.CSS — Icons
- Usage
- Example
- Icons Demo
- Font Awesome Icon Demo
- Google Material Design Icon Demo
- Bootstrap Icon Demo
- Button with Icon Demo
- Get Started
- Add the Viewport Meta Element
- Understand Pure Grids
- Responsive Grids
- Pure css что это
- A set of small, responsive CSS modules that you can use in every web project.
- CSS with a minimal footprint.
- Your CSS foundation.
- Made with mobile in mind.
- Stays out of your way.
- Create responsive layouts.
- Create your own look and feel.
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 salient 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 library 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 lines 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 Delivery 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 −
.grids-exampleFirst Column
Second Column
Third Column
It will produce the following result −
CDN Based Version
You can include the pure.css file into your HTML code directly from the Content Delivery Network (CDN). yui.yahooapis.com provides content for the latest version.
We are using yui.yahooapis.com CDN version of the library throughout this tutorial.
Example
Now let us rewrite the above example using pure.css from PureCSS.io CDN.
.grids-exampleFirst Column
Second Column
Third Column
It will produce the following result −
Pure.CSS — Responsive Design
Pure.CSS has several special classes to create a responsive design.
Sets the container to occupy required space on any device.
Sets the container to occupy required space on a device with width ≥ 568px.
Sets the container to occupy required space on a device with width ≥ 768px.
Sets the container to occupy required space on a device with width ≥ 1024px.
Sets the container to occupy required space on a device with width ≥ 1280px.
In the following example, we’re going to create a responsive grid with a row having four columns. The columns should stack on small screens, should take up width: 50% on medium-sized screens, and should take up width: 25% on large screens.
This is done by adding .pure-u-1 class for small screens, .pure-u-md-1-2 for mediumsized screens, and .pure-u-lg-1-4 for large screens. Resize the page to see the grid response to the screen size.
Example
.grids-example < background: rgb(250, 250, 250); margin: 2em auto; font-family: Consolas, 'Liberation Mono', Courier, monospace; text-align: center; >.grayboxThese four columns should stack on small screens, should take up width: 50% on medium-sized screens, and should take up width: 25% on large screens.
First Column
Second Column
Third Column
Fourth Column
This column is to occupy the complete space of a row.
This column is to occupy the two-fifth of the space of a row.
This column is to occupy the three-fifth of the space of a row.
Column 1: This column is to occupy the one-third of the space of a row on all devices.
Column 2: This column is to occupy the one-third of the space of a row on all devices.
Column 3: This column is to occupy the one-third of the space of a row on all devices.
Result
Pure.CSS — Grids
Pure.CSS provides the concept of Pure Grid with two types of classes, pure-g, a grid class and unit classes, pure-u-*. Following are the rules to use Pure Grids.
- Widths of Units are in fractions. For example, pure-u-1-2 represents 1/2 or 50% width, pure-u-2-5 represents 2/5 or 40% width and so on.
- Children of Pure Grid (element with pure-g class) must be using pure-u or pure-u-* classnames.
- All content should to be a part of a grid unit to be rendered properly.
Grid Unit Sizes
Pure Grid comes with 5th and 24th unit sizes. Following illustrations show the examples of some of the available units, which can be appended to pure-ui-. For example, to create a cell of 50% width, you can use a css style pure-ui-1-2.
5 th Based Units
.grids-example < background: rgb(250, 250, 250); margin: 2em auto; font-family: Consolas, 'Liberation Mono', Courier, monospace; text-align: center; >.grid-unit < margin: 0.25em 0; padding-left: 4.5em; >.grid-unit .grid-unit-width < font-family: Consolas, 'Liberation Mono', Courier, monospace; >.grid-unit-bar1-52-53-54-511-1
Result
24 th Based Units
.grids-example < background: rgb(250, 250, 250); margin: 2em auto; font-family: Consolas, 'Liberation Mono', Courier, monospace; text-align: center; >.grid-unit < margin: 0.25em 0; padding-left: 4.5em; >.grid-unit .grid-unit-width < font-family: Consolas, 'Liberation Mono', Courier, monospace; >.grid-unit-bar1-241-122-243-241-84-241-65-241-46-247-241-322-2423-2411-124-24
Result
Pure.CSS — Forms
Pure.CSS has a very beautiful and responsive CSS for form designs. The following CSS are used −
Represents a compact inline form.
Represents a stacked form with input elements below the labels. To be used with pure-form.
Represents an aligned form with input elements below the labels. To be used with pure-form.
Displays a form control with rounded corners