Open In App

Tailwind CSS Outline

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. This class is used to control an element’s outline.

Outline Classes:

  • outline-none: This class is used to hide the default browser outline on focused elements.
  • outline-white: This class is used to add a white 2px dotted border around an element with a 2px offset.
  • outline-black: This class is used to add a black 2px dotted border around an element with a 2px offset.

Syntax:

<element class="outline-{style}">...</element>

Example:

HTML




<!DOCTYPE html>
<html>
<head>
    <link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
        rel="stylesheet">
</head>
 
<body class="text-center mx-4 space-y-2">
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1>
    <b>Tailwind CSS Outline Class</b>
    <div class="mx-6 bg-green-200 grid grid-rows-3
                grid-flow-col text-justify p-4">
 
        <input class="placeholder-gray-500 p-3 m-2 rounded-lg
                    border-2 border-green-400 bg-green-100
                    focus:outline-none"
               placeholder="Outline-none">
        <input class="placeholder-gray-500 p-3 m-2 rounded-lg
                      border-2 border-green-400 bg-green-100
                      focus:outline-white"
               placeholder="Outline-white">
 
        <input class="placeholder-gray-500 p-3 m-2 rounded-lg
                    border-2 border-green-400 bg-green-100
                    focus:outline-black"
               placeholder="Outline-black">
    </div>
</body>
 
</html>


Output:



Last Updated : 09 Dec, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads