W3Schools
w3schools.com › css › css_border.asp
CSS Borders
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border
border - CSS | MDN
#example-element { background-color: #eeeeee; color: darkmagenta; padding: 0.75em; width: 80%; height: 100px; } This property is a shorthand for the following CSS properties: ... /* style */ border: solid; /* width | style */ border: 2px dotted; /* style | color */ border: outset #ff3333; /* ...
Videos
02:36
Learn CSS borders in 2 minutes 🔲 - YouTube
02:12
#119 Border Styling- The Web Dev's Toolkit: HTML, CSS, and ...
Learn CSS Border Animations in 6 Minutes
04:27
Learn CSS borders in 4 minutes! 🖼 - YouTube
08:31
CSS - Borders and the Border-Style property - YouTube
Learn CSS borders in 2 minutes
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border-style
border-style - CSS | MDN
#example-element { background-color: #eeeeee; color: black; border: 0.75em solid; padding: 0.75em; width: 80%; height: 100px; } body { background-color: white; } This property is a shorthand for the following CSS properties:
W3Schools
w3schools.com › cssref › pr_border.php
CSS border property
border: border-width border-style border-color|initial|inherit; ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] · If you want to report an error, or if you ...
W3Schools
w3schools.com › cssref › pr_border-style.php
CSS border-style property
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML.
HubSpot
blog.hubspot.com › website › css-border
How to Create and Style Borders in CSS
February 23, 2023 - Let’s take a look at examples defined by different border-image values below. See the Pen CSS Image Border by Christina Perricone (@hubspot) on CodePen. You can also use the CSS border-image property to set a CSS gradient as a border. To create the border gradient, set the border-image property to “linear-gradient” or “repeating-linear-gradient.” Then, in parentheses, add as many color stops as you want. You can use any combination of HTML ...
HTML Dog
htmldog.com › guides › css › beginner › borders
Borders | HTML Dog
Add the following code to the CSS file: h2 { border-style: dashed; border-width: 3px; border-left-width: 10px; border-right-width: 10px; border-color: red; } This will make a red dashed border around all HTML secondary headers (the h2 element) that is 3 pixels wide on the top and bottom and ...
Programiz
programiz.com › css › borders
CSS Borders (With Examples)
The border-color property adds color to the element's border. For example, ... <!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-color</title> </head> <body> <p class="first">border-color: blue;</p> <p class="second">border-color: orange;</p> </body> </html>
Codecademy
codecademy.com › docs › css › borders
CSS | Borders | Codecademy
May 27, 2025 - ... style: Defines the line style - must be specified for border to appear (solid, dotted, dashed, double, groove, ridge, inset, outset, none, hidden) color: Sets the border color using any valid CSS color value ...
CodeWithHarry
codewithharry.com › tutorial › css-borders
Borders | CSS Tutorial | CodeWithHarry
<html lang="en"> <head> <style> p { border: 2px solid red; } </style> </head> <body> <p>Hello world, I'm CodeWithHarry</p> </body> </html> Border Style → Defines how the border looks (dotted, solid, dashed, etc.). Border Color → Sets the color of the border.
W3Schools
w3schools.com › css › css_border_sides.asp
CSS Border Sides
The border-style property is used in the example above. However, it also works with border-width and border-color. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] · If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected] · HTML Tutorial CSS ...
W3Schools
w3schools.com › html › html_table_borders.asp
HTML Table Borders
To add a border, use the CSS border property on table, th, and td elements: table, th, td { border: 1px solid black; } Try it Yourself » · To avoid having double borders like in the example above, set the CSS border-collapse property to collapse.
Quackit
quackit.com › html › codes › html_borders.cfm
HTML Borders
For a full list of border properties, check out the list of CSS properties and filter by "border". ... You can combine different border types and styles for each side of the HTML element. ... All of the above examples use embedded styles to create the borders.
TutorialsPoint
tutorialspoint.com › css › css_borders.htm
CSS - Borders
<html> <head> <style> p { border-top-style: dotted; border-right-style: solid; border-bottom-style: dashed; border-left-style: double; padding: 2em; } </style> </head> <body> <h2>Border Style Individual Side</h2> <p>Different border styles on all sides.</p> </body> <html>
Top answer 1 of 8
520
Try being explicit about all the border properties. For example:
border:1px solid black;
See Border shorthand property. Although the other bits are optional some browsers don't set the width or colour to a default you'd expect. In your case I'd bet that it's the width that's zero unless specified.
2 of 8
58
You can use:
border-width:2px;
border-style:solid;
border-color:black;
or as shorthand:
border: 2px solid black