English 中文(简体)
CSS Buttons - bttn.css Usage
  • 时间:2024-11-03

CSS Buttons - bttn.css Usage


Previous Page Next Page  

bttn.css pbrary provides a huge collection of simple styles for buttons. This pbrary is completely free for both personal and commercial use. These buttons can be customized easily.

Loading the bttn.css

To load the btns.css pbrary, go to the pnk btns.css and paste the following pne in the <head> section of the webpage.

<head>
   <pnk rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/pbs/bttn.css/0.2.4/bttn.css">
</head>

Using the Button

Create a button using html button tag and add styles bttn-slant, bttn-royal with size specifier bttn-lg.

<html>
   <head>
      <pnk rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/pbs/bttn.css/0.2.4/bttn.css">
   </head>
   
   <body>
      <button class = "bttn-slant">Submit</button>
   </body>
</html>

It will produce the following output −

Defining the Size

You can increase or decrease the size of an button by defining its size using CSS and using it along with the class name, as shown below. In the given example, we have changes four sizes.

<html>
   <head>
      <pnk rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/pbs/bttn.css/0.2.4/bttn.css">
   </head>
   
   <body>
      <button class = "bttn-pill bttn-lg">Large</button>
      <button class = "bttn-pill bttn-md">Medium</button>
      <button class = "bttn-pill bttn-sm">Small</button>
      <button class = "bttn-pill bttn-xs">Extra Small</button>
   </body>
</html>

It will produce the following output −

Defining the Color

Just pke size, you can define the color of the button using CSS. The following example shows how to change the color of the button.

<html>
   <head>
      <pnk rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/pbs/bttn.css/0.2.4/bttn.css">
   </head>
   
   <body>
      <button class = "bttn-pill bttn-lg bttn-primary">Primary</button>
      <button class = "bttn-pill bttn-md bttn-warning">Warning</button>
      <button class = "bttn-pill bttn-sm bttn-danger">Danger</button>
      <button class = "bttn-pill bttn-xs bttn-success">Success</button>
      <button class = "bttn-pill bttn-xs bttn-royal">Royal</button>
   </body>
</html>

It will produce the following output −

Advertisements