Loading Please Wait...

Logo Lynxsia IT Solutions

CSS Borders

CSS Borders

CSS allow us to handle border of the elements. We can set color, image, size, etc. of the border. CSS has border or border-* properties for the border.

  • Border Width
  • Border Color
  • Border Style
  • Border Radius
  • Border Sides
  • Border Image
  • Border Block
  • Border Inline
  • Border Collapse
  • Border Spacing
  • Border Shorthand
Border Width

Sets the border width of the selected element.

We can use any length value such as px, in, cm, rem, etc. and thick, thin keyword value as well.

Syntax = border-width: 1px;

					 
        
          p{        
            border-width: thin;
          }
        
      
Border Color

Sets the border color of the selected element.

We can give any color value like name, HEX, HEXA, RGB, RGBA, HSL, HSLA, etc.

Syntax = border-color: red;

					 
        
          p{        
            border-color: red;
          }
        
      
Border Style

Sets the style of the border of the selected element.

Syntax = border-style: solid;

					 
        
          div{        
            border-style: double;
          }
        
      
Border Radius

Sets the roundness of the border of the selected element.

Syntax = border-radius: 10px;

					 
        
          div{        
            border-radius: 0.5rem;
          }
        
      
Border Sides

We can set individual side of the border such as top, bottom, left, end, etc.

Syntax = border-top: 10px;

					 
        
          div{        
            border-end-end-radius: 0.5rem;
          }
        
      
Border Image

Sets the border image of the selected element.

Syntax = border-image: url("image.png");

					 
        
          div{        
            border-image: url("image.png");
          }
        
      
Border Block

Sets the top and bottom border.

Syntax = border-block: red;

					 
        
          div{        
            border-block: 0.5rem;
          }
        
      
Border Inline

Sets the left and right border.

Syntax = border-inline: red;

					 
        
          div{        
            border-inline: 0.5rem;
          }
        
      
Border Collapse

Sets whether the border of the cell inside HTML <table> element should overlap with each other or be separated.

Syntax = border-collapse: collapse;

					 
        
          div{        
            border-collapse: separate;
          }
        
      
Border Spacing

Sets the spacing between borders of the cell inside HTML <table> element.

Syntax = border-spacing: 0;

					 
        
          div{        
            border-spacing: 1em;
          }
        
      
Border Shorthand

Sets the border properties in a single line.

Syntax = border: 5px solid red;

					 
        
          div{        
            border: dashed blue 0.5rem;
          }
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved