Open In App

Tachyons Layout

Tachyons is a toolkit that is used to create a responsive website. In this article, we will learn how to define any layout using the Tachyons toolkit. 

Every website is divided into various parts like header, menus, content, and a footer. Tachyons Layout is used to define those sub-parts of a website.



The layout offered by Tachyons toolkit is listed below:

Syntax:



<element-name class="class-name">
    ...
</element-name>

Example 1: In the below code we will make use of the widths class that is used to define the width of the element.




<!DOCTYPE html>
<html>
  
<head>
    <title>GFG</title>
    <link rel="stylesheet" href=
  
    <style>
        body {
            text-align: center;
            margin: 20px;
        }
  
        h1 {
            background-color: green;
        }
    </style>
</head>
  
<body>
    <h1 class="w1">GeeksforGeeks</h1>
    <h1 class="w5">GeeksforGeeks</h1>
    <h1 class="w9">GeeksforGeeks</h1>
</body>
  
</html>

Output:

 

Example 2: Below example demonstrates the Tachyons LAYOUT using Spacing classes.




<!DOCTYPE html>
<html>
  
<head>
    <title>GFG</title>
    <link rel="stylesheet" href=
  
    <style>
        body {
            text-align: center;
            margin: 20px;
        }
  
        h1 {
            background-color: green;
        }
    </style>
</head>
  
<body>
    <h1 class="pa1">GeeksforGeeks</h1>
    <h1 class="pa3">GeeksforGeeks</h1>
    <h1 class="pa5">GeeksforGeeks</h1>
</body>
  
</html>

Output:

 

Reference: https://tachyons.io/docs/


Article Tags :