Open In App

Primer CSS Selects Forms

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

In this article, we will discuss Primer CSS Selects Forms. Primer CSS adds styles like vertical-align and light height to the selection for all the supporting browsers to generate them consistently with textual inputs.



Primer CSS Selects Forms Classes:

Syntax:



<form>
      <select class="form-select">
        <option>.......</option>
      </select>
</form>

Example 1: Below example demonstrates the use of Primer CSS Selects Forms.




<!DOCTYPE html>
<html>
  
<head>
    <title>Primer CSS Selects Forms</title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^19.0.0/dist/primer.css" />   
</head>
  
<body>
    <center>
        <h1 class="color-fg-success">GeeksforGeeks</h1>
        <h3>Primer CSS Selects Forms</h3>
        <form>
            <select class="form-select mt-5">
              <option>Choose any Course</option>
              <option>Data Structure</option>
              <option>DBMS</option>
              <option>OOP's</option>
            </select>
        </form>
    </center>
</body>
  
</html>

Output:

Primer CSS Selects Forms

Example 2: Below is another example that demonstrates the use of Primer CSS Selects Forms using the select-sm class.




<!DOCTYPE html>
<html>
  
<head>
  <title>Primer CSS Selects Forms</title>
  <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^19.0.0/dist/primer.css" />   
</head>
  
<body>
    <center>
        <h1 class="color-fg-success">GeeksforGeeks</h1>
        <h3>Primer CSS Selects Forms</h3>
        <form>
            <select class="form-select select-sm mt-5">
              <option>Choose any Course</option>
              <option>Data Structure</option>
              <option>Operating System</option>
              <option>OOP's</option>
              <option>DBMS</option>
            </select>
        </form>
    </center>
</body>
  
</html>

Output:

Primer CSS Selects Forms

Reference: https://primer.style/css/components/forms#selects


Article Tags :