Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

12. CSS - Borders

Lesson 12 of 34 in the free CSS Customization: Zero to Hero notes on Siksha Sarovar, written by Rohit Jangra.

CSS Borders

The CSS border properties allow you to specify the style, width, and color of an element's border.

1. Border Style

The border-style property specifies what kind of border to display.

  • dotted: Defines a dotted border.
  • dashed: Defines a dashed border.
  • solid: Defines a solid border.
  • double: Defines a double border.
  • none: Defines no border.
  • hidden: Defines a hidden border.

2. Border Width

The border-width property specifies the width of the four borders. The width can be set as a specific size (in px, pt, cm, em, etc) or by using one of the three pre-defined values: thin, medium, or thick.

3. Border Color

The border-color property is used to set the color of the four borders.

4. Individual Sides

You can specify the border for just one side.

  • border-top-style
  • border-right-style
  • border-bottom-style
  • border-left-style

5. Shorthand Property

To shorten the code, it is possible to specify all the border properties in one property. The border property is a shorthand property for the following individual border properties:

  • border-width
  • border-style (required)
  • border-color
p {
  border: 5px solid red;
}