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.

Answer from Paolo on Stack Overflow
🌐
W3Schools
w3schools.com › css › css_border.asp
CSS Borders
Note: None of the OTHER CSS border properties (which you will learn more about in the next chapters) will have ANY effect unless the border-style property is set! ... 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 Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
W3Schools
w3schools.com › html › html_table_borders.asp
HTML Table Borders
HTML tables can have borders of different styles and shapes.
Discussions

css - How to set a border for an HTML div tag? - Stack Overflow
I am trying to define a border around a div tag in HTML. In some browsers the border does not appear. Here is my HTML code: ... More on stackoverflow.com
🌐 stackoverflow.com
css - How do I add a border to an image in HTML? - Stack Overflow
I noticed the original question was not "How to add a border to an image," but instead it was "how to add in a box around an image using html?" The question was re-written by others, so I'm not 100% sure you wanted a border on your image. More on stackoverflow.com
🌐 stackoverflow.com
Text in Border CSS HTML - Stack Overflow
I'd like to have a div that looks like this: Is this possible to do with HTML + CSS? I will also be animating this div with jQuery. When the div is hidden I would like the title and the top line t... More on stackoverflow.com
🌐 stackoverflow.com
html - how to make a border around content - Stack Overflow
I want the to create a border around my content, but when ever i try to make the border all the content disappear , how can i make a border around the content without ma... More on stackoverflow.com
🌐 stackoverflow.com
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border
border - CSS | MDN
2 weeks ago - border = <line-width> || <line-style> || <color> <line-width> = <length [0,∞]> | thin | medium | thick <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset · html · <div>I have a border, an outline, and a box shadow!
🌐
HTML Dog
htmldog.com › guides › css › beginner › borders
Borders | HTML Dog
To make a border around an element, all you need is border-style.
🌐
GeeksforGeeks
geeksforgeeks.org › css › css-borders
CSS Borders - GeeksforGeeks
November 1, 2025 - CSS borders define the outline around an HTML element, providing visual separation and emphasis within a webpage layout.
🌐
Screenstepslive
utah.screenstepslive.com › a › 1865460-basic-borders-and-line-properties
Basic Borders and Line Properties | Advanced HTML Elements | University of Utah
August 23, 2024 - In this page of the borders and lines tutorial, we'll address basic border and line properties: border-width (thickness), border-style, and border-color.
Find elsewhere
🌐
W3Schools
w3schools.com › css › css_border_sides.asp
CSS Border Sides
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 Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
GeeksforGeeks
geeksforgeeks.org › html › how-to-add-border-in-html
How To Add Border In HTML? - GeeksforGeeks
July 23, 2025 - Example: In this example, the div styled to have the green solid border on the top side and the purple dotted border on the right side. It will highlighted only the specified sides of the div. ... <!DOCTYPE html> <html> <head> <style> .box { border-top: 5px solid green; border-right: 5px dotted purple; } </style> </head> <body> <h1 style="color: green;">GeeksforGeeks</h1> <div class="box">This div has borders on the top and right sides.</div> </body> </html>
🌐
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 want to make a suggestion, send us an e-mail: [email protected] · HTML ...
🌐
W3Schools
w3schools.com › css › css_boxmodel.asp
W3Schools.com
The CSS box model is essentially a box that wraps around every HTML element. Every box consists of four parts: content, padding, borders and margins.
🌐
YouTube
youtube.com › watch
HTML & CSS for Absolute Beginners: Box model - Borders - YouTube
🎓 Enroll in this course for FREE - get additional lessons, written content, interactive exercises, and more: learn.kevinpowell.co📂 Get the course files her...
Published   January 10, 2025
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-border-attribute
HTML border attribute - GeeksforGeeks
July 12, 2025 - The HTML border attribute is used to set the visible border width to most HTML elements within the body.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border-style
border-style - CSS - MDN Web Docs - Mozilla
The border-style shorthand CSS property sets the line style for all four sides of an element's border.