Border Properties

PropertyPossible ValuesDescription
borderShorthand for border-width, border-style, border-colorExample: border: 2px solid red;
border-widththin, medium, thick, px, %Sets the width of the border
border-stylesolid, dashed, dotted, double, groove, ridge, inset, outset, noneDefines the border’s style
border-colorAny color value (red, #ff0000, rgb(255, 0, 0))Specifies the border color
border-topCombines border-top-width, border-top-style, border-top-colorExample: border-top: 3px dashed blue;
border-rightCombines border-right-width, border-right-style, border-right-colorExample: border-right: 2px solid black;
border-bottomCombines border-bottom-width, border-bottom-style, border-bottom-colorExample: border-bottom: 4px double green;
border-leftCombines border-left-width, border-left-style, border-left-colorExample: border-left: 1px dotted orange;
border-radiuspx, %Rounds the corners of the border (Example: border-radius: 10px;)

How Border Shorthand Works

Value FormatExampleEffect
border: none;border: none;Removes the border
border: 2px solid black;border: 2px solid black;Black solid border with 2px width
border: 3px dashed red;border: 3px dashed red;Red dashed border with 3px width
border-radius: 50%;border-radius: 50%;Creates a circular shape (for a square element)

Example:

.box {
    width: 200px;
    height: 100px;
    border: 3px solid blue;
    border-radius: 10px;
    padding: 10px;
}
✔ Solid blue border (3px)
✔ Rounded corners (10px)
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad