Border Style Property

Last updated: 2026-09-13

border-style Border Style Property

border-style defines the appearance of the border line, such as solid, dashed, or dotted. It is the key to whether a border is visible at all — even with border-width and border-color set, a border stays invisible when border-style is none. CSS provides 10 different line styles to choose from.

Category
Initial Valuenone
InheritedNo
Applies Toall
Animation Typediscrete
CSS VersionCSS1
StatusStandard

📝 Syntax

border-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset{1,4};

⚙️ Values

ValueTypeDescription
none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outsetKeywordThe 10 border line styles

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
border-style v1 v12 v1 v1 v1
Supported in all major browsers
Tip: solid is the most commonly used style; dashed and dotted are often used for temporary markers or draft states.
Warning: none and hidden both render no border, but hidden also suppresses neighboring borders in a table with border-collapse: collapse, so their behavior differs.

❓ FAQ

QWhy do groove, ridge, inset, and outset look flat?
AThese four 3D styles rely on the light/dark contrast of the border color to create depth, so the effect is barely visible when the color contrast is low or the border is thin. They are rarely used in modern flat UI; prefer solid combined with box-shadow for a subtle layered look.
QWhat is the difference between border-style: none and hidden?
ABoth render no border. The difference matters in tables: with border-collapse: collapse, hidden forcefully suppresses neighboring borders (highest priority), while none has lower priority and a neighboring cell's border can still show. On regular elements the two behave identically.
QWhat border line styles does CSS provide, and when should I use each?
ACSS offers 10 styles: none, hidden, solid, dashed, dotted, double, groove, ridge, inset, and outset. solid is the most common; dashed and dotted work well as separators; double adds emphasis; and the four 3D styles are rarely used in flat design. Pick based on the visual weight you need.
QHow do I create mixed styles like a dashed border on one side only?
Aborder-style accepts 1 to 4 values assigned to the top, right, bottom, and left edges, so border-style: solid dashed; gives solid top/bottom and dashed left/right. You can also combine per-side properties, e.g. border-top-style: dashed; border-bottom-style: solid; for a single dashed edge.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏