Search results
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. CSS Border Style. The border-style property specifies what kind of border to display. The following values are allowed:
- Border Width
Well organized and easy to understand Web building tutorials...
- CSS Backgrounds
You learned from our CSS Colors Chapter, that you can use...
- Border Width
Sep 18, 2023 · Learn how to use CSS to style your HTML elements with borders of different colors, widths and styles. Follow the step-by-step guide with examples and tips to create borders for tables, images and more.
- 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.
- Animated Border Image. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Responsive: no. Dependencies:
- Partial Gradient Border. Partial gradient border surrounding a circle image, which is done with a CSS conic gradient and a radial gradient mask. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari.
- Gradient Border with Rounded Corners. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Responsive: no. Dependencies:
- Background Border. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Responsive: yes. Dependencies:
CSS borders are used to add the visual border around the elements of the webpage. In this tutorial, you will learn about different border-related properties with the help of examples.
People also ask
How to define a border in CSS?
What is a border property in CSS?
What is a border shorthand CSS property?
What is border-color & border-style?
How to add a border on a Div using CSS?
What is border-image-repeat in CSS?
Apr 30, 2021 · A border provides a frame for your boxes. In this module find out how to change the size, style and color of borders using CSS.