Open In App

Foundation CSS Label Sass Reference

Last Updated : 31 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so it’s easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices.  

Labels are the caption for an item in a user interface ie., it provides the metadata for the specified field. It can be styled using the particular Foundation CSS classes.

Variable Used:

Variable-Name Description Type Default-Value
$label-background  This variable is used to define the default text color for labels. Color $primary-color 
$label-color  This variable is used to define the alternate text color for labels. Color $white 
$label-color-alt  This variable is used to define the alternate text color for labels. Color $black 
$label-palette  This variable is used for coloring classes.  Map $foundation-palette 
$label-font-size  This variable is used to define the default font size for labels. Number 0.8rem 
$label-padding  This variable is used to define the default padding inside labels. Number 0.33333rem 0.5rem 
$label-radius  This variable is used to define the default radius of labels. Number $global-radius 

Example 1: In the below code, we will make use of the above variable to demonstrate the use of the label.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <meta charset="utf-8">
    <meta name="viewport" content=
        "width=device-width,initial-scale=1">
  <!-- Compressed CSS -->
  <link rel="stylesheet" href=
    
    <link rel="stylesheet" href="style.css">
      
    <title>GeeksforGeeks</title>
   <!-- font-awesome cdn -->
   <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 class="title" style="color:green;" >
            GeeksforGeeks
        </h1>        
        <h3 class="subtitle">
            A computer science portal for geeks
        </h3>    
        <span class="label">Label 1</span>
        <span class="label">Label 2</span>
        <span class="label">Label 3</span>
        <span class="label">Label 4</span>
    </center
</body>
</html>


SASS Code:

$label-color: white;
.label {
      color:$label-color;
}

Compiled CSS Code:

.label {
      color: white;
}

Output:

 

Example 2: In the below code, we will make use of the above variable to demonstrate the use of the label.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <meta charset="utf-8">
    <meta name="viewport" content=
        "width=device-width,initial-scale=1">
  <!-- Compressed CSS -->
  <link rel="stylesheet" href=
    
    <link rel="stylesheet" href="style.css">
      
    <title>GeeksforGeeks</title>
   <!-- font-awesome cdn -->
   <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 class="title" style="color:green;" >
            GeeksforGeeks
        </h1>
          
        <h3 class="subtitle">
            A computer science portal for geeks
        </h3>    
        <span class="label">Label 1</span>
        <span class="label">Label 2</span>
        <span class="label">Label 3</span>
        <span class="label">Label 4</span>
    </center
</body>
    
</html>


SASS Code:

$label-background: green;
.label {
   background-color:$label-background;
}

Compiled CSS Code:

.label {
   background-color: green; 
}

Output:

 

Reference: https://get.foundation/sites/docs/label.html



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads