Contents
Defining border in CSS
The CSS border
property allows you to define a line border for an element:
It is actually a shorthand for three CSS line border subproperties:
border-width
- border-style
border-color
Working with border: CSS syntax
To define a line border in CSS, follow the syntax example below:
border: width style color;
The available values will be explained in the following section.

- Simplistic design (no unnecessary information)
- High-quality courses (even the free ones)
- Variety of features
- Nanodegree programs
- Suitable for enterprises
- Paid certificates of completion

- Easy to navigate
- No technical issues
- Seems to care about its users
- Huge variety of courses
- 30-day refund policy
- Free certificates of completion

- Great user experience
- Offers quality content
- Very transparent with their pricing
- Free certificates of completion
- Focused on data science skills
- Flexible learning timetable
Property values
Value | Description | Defined in | Default value |
---|---|---|---|
width | CSS border width | Length units or keywords (thin , medium , thick ) |
medium |
style | CSS border style | Keywords (none , solid , hidden , dashed , dotted , double , groove , ridge , inset , outset ) |
none |
color | CSS border color | Color names, RGB, RGBA, HEX, HSL or HSLA values. | currentcolor |
Note: you don't need to define all of the subproperties for line borders necessarily. The order is also not important.
Browser support

Chrome

Edge

Firefox

IE

Opera

Safari
Mobile browser support

Chrome

Firefox
