No, you cannot set them all in a single statement.
At the general case, you need at least three properties:

border-color: red green white blue;
border-style: solid dashed dotted solid;
border-width: 1px 2px 3px 4px;

However, that would be quite messy. It would be more readable and maintainable with four:

border-top:    1px solid  #ff0;
border-right:  2px dashed #f0F;
border-bottom: 3px dotted #f00;
border-left:   5px solid  #09f;
Answer from Kobi on Stack Overflow
🌐
W3Schools
w3schools.com › css › css_border_sides.asp
CSS Border Sides
In CSS, there are also properties for specifying each of the borders (top, right, bottom, and left): ... p { border-top-style: dotted; border-right-style: solid; border-bottom-style: dotted; border-left-style: solid; } ... We can also use the ...
🌐
W3Schools
w3schools.com › css › css_border_shorthand.asp
CSS Shorthand Border Property
CSS Reference CSS Selectors CSS Combinators CSS Pseudo-classes CSS Pseudo-elements CSS At-rules CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS Default Values CSS Browser Support ... Like you saw in the previous page, there are many properties to consider when dealing with borders. To shorten the code, it is also possible to specify all the individual border properties in one property. The border property is a shorthand property for the following individual border properties:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Shorthand_properties
Shorthand properties - CSS | MDN
Shorthands handling properties related to edges of a box, like border-style, margin or padding, always use a consistent 1-to-4-value syntax representing those edges: 1-value syntax: border-width: 1em — The single value represents all edges: 2-value syntax: border-width: 1em 2em — The first ...
🌐
HTML Dog
htmldog.com › references › css › properties › border
CSS Property: border | HTML Dog
A shorthand property that combines border-top, border-right, border-bottom, and border-left, along with border-width, border-style, and border-color.
🌐
W3docs
w3docs.com › learn-css › border.html
CSS Border shorthand Property with syntax, values and examples
The border shorthand property is used when you want to make all four sides the same. You can change borders with the help of border-width, border-style, and border-color properties, which can set different values for each side.
🌐
Udacity
udacity.com › blog › 2021 › 03 › the-easy-guide-to-the-css-border-shorthand-property.html
The Easy Guide to the CSS Border Shorthand Property | Udacity
August 17, 2021 - This is accomplished by adding the direction you intend to manipulate into the border property declaration. ... The direction is prefixed with a hyphen. See the example code below for a direct demonstration of this.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border-width
border-width - CSS | MDN
This property is a shorthand for the following CSS properties: ... /* Keyword values */ border-width: thin; border-width: medium; border-width: thick; /* <length> values */ border-width: 4px; border-width: 1.2rem; /* top and bottom | left and right */ border-width: 2px 1.5em; /* top | left and right | bottom */ border-width: 1px 2em 1.5cm; /* top | right | bottom | left */ border-width: 1px 2em 0 4rem; /* Global values */ border-width: inherit; border-width: initial; border-width: revert; border-width: revert-layer; border-width: unset;
🌐
WebPlatform
webplatform.github.io › docs › guides › css_shorthand
CSS shorthand guide · WebPlatform Docs
You will very rarely want to go this granular; you will probably use simply border or border-left/-right/-top/-bottom in most cases. The more granular options will likely be used only if you want to override an earlier border declaration. Shorthand for margin, padding, and outline all works ...
Find elsewhere
🌐
W3Schools
w3schools.com › css › css_border.asp
CSS Borders
The CSS border properties allow you to specify the style, width, and color of an element's border. I have borders on all sides. I have a red, bottom border. I have rounded borders. I have a blue, left border. The border-style property specifies what kind of border to display. ... The border-style property can have from one to four values (for the top border, right ...
🌐
CSS-Tricks
css-tricks.com › how-do-you-put-a-border-on-three-sides-of-an-element
How Do You Put a Border on Three Sides of an Element? | CSS-Tricks
October 3, 2018 - .three-sides { border-color: black; border-style: solid; /* top, right, bottom, left - just like margin and padding */ border-width: 0 2px 2px 2px; }
🌐
Vibes News
mariamalarab.com › blog › css-border-styles-top-bottom
CSS Border Styles: Top, Bottom, Left, And Right Explained
November 15, 2025 - The basic syntax for the shorthand border property is: ... But what if you want a different border on the top compared to the bottom? Or maybe a dashed border on the left and a solid one on the right? That's where the individual border properties come in. And, let’s be real, that’s where the real fun begins.
🌐
Codecademy Forums
discuss.codecademy.com › frequently asked questions › css faq
Setting a border for one or two sides of the element - CSS FAQ - Codecademy Forums
July 7, 2018 - It is not really possible through the border property but we can use its derivatives: border-top border-right border-bottom border-left Each one of them follows the same value structure for border: width style color; So, to have a white top ...
🌐
MarkSheet
marksheet.io › css-border.html
CSS border - Free tutorial to learn HTML and CSS
For example, for a bottom border, you can write: blockquote{ border-bottom-color: yellow; border-bottom-style: solid; border-bottom-width: 1px;} As for the border property, each side has its shorthand ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border
border - CSS | MDN
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.
🌐
Panda-css
panda-css.com › docs › utilities › border
Border | Panda CSS - Panda CSS
<div className={css({ borderStartRadius: 'md' })} /> <div className={css({ roundedStart: 'md' })} /> // shorthand ... Use the border{Left|Right|Top|Bottom}Width properties, to apply border width on a specific side of an element.
🌐
Programiz
programiz.com › css › border-shorthand
CSS border Property (With Examples)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="style.css" /> <title>CSS border</title> </head> <body> <h1>CSS border Property</h1> </body> </html> h1 { /* border-width border-style border-color */ border: 4px solid blue; padding: 8px; } ... border-top: 4px solid blue; border-right: 4px solid blue; border-bottom: 4px solid blue; border-left: 4px solid orange;
🌐
BigBinary Academy
courses.bigbinaryacademy.com › learn-css › borders › side-border-shorthand-property
Side Border Shorthand Property - CSS | BigBinary Academy
Use the individual side border shorthand properties, `border-top`, `border-bottom`, `border-left` and `border-right` as shown below:
🌐
HTML Dog
htmldog.com › references › css › properties › border-top
CSS Property: border-top | HTML Dog
A shorthand property that combines border-top-width, border-top-style, and border-top-color. The top border, combined with right, bottom, and left border, can also be specified with the border shorthand property.
🌐
HTML Dog
htmldog.com › references › css › properties › border-width
CSS Property: border-width | HTML Dog
border-width is itself a shorthand property. Border width can be set on sides independently with border-top-width, border-right-width, border-bottom-width, and border-left-width.