🌐
HTML Dog
htmldog.com › references › css › properties › border-width
CSS Property: border-width | HTML Dog
The width of the border of a box, around the content and padding areas and before the margin area.
🌐
Fandom
htmlcss.fandom.com › wiki › Border-width
Border-width | HTML & CSS Wiki | Fandom
The border-width property is used in CSS and certain HTML elements. This is a shorthand property which allows authors to specify the border-top-width, border-right-width, border-bottom-width, and border-left-width properties using a single property and value notation (the values are given in this order separated by spaces).
Discussions

CSS border less than 1px - Stack Overflow
The minimum width that your screen can display is 1 pixel. So its impossible to display less then 1px. 1 pixels can only have 1 color and cannot be split up. ... But but, on retina... 2014-11-15T10:30:44.35Z+00:00 ... My browser does render an input box with a border that is thinner than the 1 pixel HTML ... More on stackoverflow.com
🌐 stackoverflow.com
How do I adjust the length of the border around my text so that there isn't a huge blank space at the end of it?
It's hard to tell because we don't know what the cell or medium-5 classes do. However, padding: 2% is doing you no favors. If I run this code even without having access to the cell or medium-5 classes, there is considerable padding around the text. If nothing else, remove padding: 2% and if you need to add some back, add it in specifically as pixels. You can add padding specifically like this: padding: [top px] [right px] [bottom px] [left px]; such as: padding: 4px 10px 0px 10px; More on reddit.com
🌐 r/HTML
5
2
August 8, 2022
Prevent cell resize when adding a border to it
a common trick to avoid elements resizing when given a border, is to make them always have the border and just changing the color from transparent to whatever. https://jsfiddle.net/cers/c9trhwew/ More on reddit.com
🌐 r/css
3
2
December 6, 2016
How to round the corners on a container in HTML without CSS?
Why are you trying to live in the stone age’ just use css More on reddit.com
🌐 r/HTML
10
0
July 16, 2024
🌐
HTMLHelp
htmlhelp.com › reference › css › box › border-width.html
Border Width
The border-width property is used to set the border width of an element by specifying between one and four values, where each value is a keyword or a length.
🌐
W3Schools
w3schools.com › css › css_border_width.asp
CSS Border Width
Outline Outline Width Outline Color Outline Shorthand Outline Offset CSS Text · Text Color Text Alignment Text Decoration Text Transformation Text Spacing Text Shadow CSS Fonts · Font Family Font Web Safe Font Fallbacks Font Style Font Size Font Google Font Pairings Font Shorthand CSS Icons CSS Links CSS Lists CSS Tables · Table Borders Table Size Table Alignment Table Styling Table Responsive CSS Display CSS Max-width CSS Position CSS Z-index CSS Overflow CSS Float
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border-width
border-width - CSS - MDN Web Docs - Mozilla
August 13, 2025 - border-width = <'border-top-width'>{1,4} <border-top-width> = <line-width> <line-width> = <length [0,∞]> | thin | medium | thick · html ·
🌐
TechOnTheNet
techonthenet.com › css › properties › border_width.php
CSS: border-width property
This CSS tutorial explains how to use the CSS property called border-width with syntax and examples. The CSS border-width property defines the border width of a box.
🌐
GeeksforGeeks
geeksforgeeks.org › css › css-border-width-property
CSS Border Width Property %%page%% %%sep%% %%sitename%% - GeeksforGeeks
July 11, 2025 - </div> </body> </html> ... Here, border-width: 5px 10px sets the top and bottom borders to 5px and the left and right borders to 10px.
🌐
W3Schools
w3schools.com › jsref › prop_style_borderwidth.asp
HTML DOM Style borderWidth Property
The borderWidth property sets or returns the width of an element's border.
Find elsewhere
🌐
Mimo
mimo.org › glossary › css › border-width
CSS border-width: Customize element borders effortlessly
Learn CSS border-width to define border thickness precisely. Create dynamic designs, highlight elements, and improve layouts with this essential property.
🌐
W3Schools
w3schools.com › cssref › pr_border-width.php
CSS border-width property
Note: Always declare the border-style property before the border-width property. An element must have borders before you can set the width. ... The numbers in the table specify the first browser version that fully supports the property. border-width: medium|thin|thick|length|initial|inherit;
🌐
WebPlatform
webplatform.github.io › docs › css › properties › border-width
border-width · WebPlatform Docs
Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
Top answer
1 of 4
248

A pixel is the smallest unit value to render something with, but you can trick thickness with optical illusions by modifying colors (the eye can only see up to a certain resolution too).

Here is a test to prove this point:

div { border-color: blue; border-style: solid; margin: 2px; }

div.b1 { border-width: 1px; }
div.b2 { border-width: 0.1em; }
div.b3 { border-width: 0.01em; }
div.b4 { border-width: 1px; border-color: rgb(160,160,255); }
<div class="b1">Some text</div>
<div class="b2">Some text</div>
<div class="b3">Some text</div>
<div class="b4">Some text</div>

Output

Which gives the illusion that the last DIV has a smaller border width, because the blue border blends more with the white background.


Edit: Alternate solution

Alpha values may also be used to simulate the same effect, without the need to calculate and manipulate RGB values.

.container {
  border-style: solid;
  border-width: 1px;
  
  margin-bottom: 10px;
}

.border-100 { border-color: rgba(0,0,255,1); }
.border-75 { border-color: rgba(0,0,255,0.75); }
.border-50 { border-color: rgba(0,0,255,0.5); }
.border-25 { border-color: rgba(0,0,255,0.25); }
<div class="container border-100">Container 1 (alpha = 1)</div>
<div class="container border-75">Container 2 (alpha = 0.75)</div>
<div class="container border-50">Container 3 (alpha = 0.5)</div>
<div class="container border-25">Container 4 (alpha = 0.25)</div>
2 of 4
6

It's impossible to draw a line on screen that's thinner than one pixel. Try using a more subtle color for the border instead.

🌐
Tailwind CSS
tailwindcss.com › docs › border-width
border-width - Borders - Tailwind CSS
Use border or border-<number> utilities like border-2 and border-4 to set the border width for all sides of an element:
🌐
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 ...
🌐
HubSpot
blog.hubspot.com › website › css-border
How to Create and Style Borders in CSS
February 23, 2023 - Like the border-style property, the border-width property can have between one and four values. If only one value is defined, then it applies to all sides of the element. If two values are defined, then the first value represents the top and bottom border widths and the second represents the right and left border widths.
🌐
W3Schools
w3schools.com › css › css_border.asp
CSS Borders
Outline Outline Width Outline Color Outline Shorthand Outline Offset CSS Text · Text Color Text Alignment Text Decoration Text Transformation Text Spacing Text Shadow CSS Fonts · Font Family Font Web Safe Font Fallbacks Font Style Font Size Font Google Font Pairings Font Shorthand CSS Icons CSS Links CSS Lists CSS Tables · Table Borders Table Size Table Alignment Table Styling Table Responsive CSS Display CSS Max-width CSS Position CSS Z-index CSS Overflow CSS Float
🌐
HTML Dog
htmldog.com › guides › css › beginner › borders
Borders | HTML Dog
Borders can be applied to most ... dotted, dashed, double, groove, ridge, inset and outset. Basic border styles. border-width sets the width of the border, most commonly using pixels as a value....
🌐
Quackit
quackit.com › html › codes › html_borders.cfm
HTML Borders
All of the above examples use embedded styles to create the borders. You can also use external styles to apply the styles across multiple pages or a whole website. To do this, simply copy everything between the style tags and put it into your external style sheet, then replace the style tags with a link tag that points to your external style sheet. Free HTML tutorial that explains how to code in HTML.