Search results
Learn how to use the CSS border property to set the style, width and color of the borders for different elements. See examples, syntax, browser support and related pages.
- Borders
CSS Border Style. The border-style property specifies what...
- Borders
Learn how to use the CSS border properties to specify the style, width, and color of an element's border. See examples of different border styles, such as dotted, dashed, solid, double, groove, ridge, inset, outset, none, and hidden.
- Overview
- Constituent properties
- Syntax
- Description
The border shorthand CSS property sets an element's border. It sets the values of border-width, border-style, and border-color.
This property is a shorthand for the following CSS properties:
•border-color
•border-style
•border-width
Values
Sets the thickness of the border. Defaults to medium if absent. See border-width. Sets the style of the border. Defaults to none if absent. See border-style. Sets the color of the border. Defaults to currentcolor if absent. See border-color.
As with all shorthand properties, any omitted sub-values will be set to their initial value. Importantly, border cannot be used to specify a custom value for border-image, but instead sets it to its initial value, i.e., none.
The border shorthand is especially useful when you want all four borders to be the same. To make them different from each other, however, you can use the longhand border-width, border-style, and border-color properties, which accept different values for each side. Alternatively, you can target one border at a time with the physical (e.g., border-top ) and logical (e.g., border-block-start) border properties.
People also ask
What is CSS border-style property?
What is CSS border-color property?
What is CSS border-color & border-width?
What is a border shorthand CSS property?
What is the difference between border width and CSS border style?
What is a border-style property?
Aug 31, 2011 · The border property is a shorthand syntax in CSS that accepts multiple values for drawing a line around the element it is applied to.
Feb 16, 2024 · Learn how to style and color the borders of HTML elements using CSS border property and its subproperties. See examples, syntax, and use cases of border-width, border-style, and border-color.
Jun 13, 2024 · The CSS border property enables the styling of an element’s border by setting its width, style, and color, allowing for customizable visual boundaries in web design. 1. Border Style
Learn how to use CSS borders to add visual borders around web page elements. Explore different border-related properties such as style, width, color, radius and image with examples and a tutorial.