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>
Answer from Yanick Rochon on Stack Overflow
🌐
W3Schools
w3schools.com › cssref › pr_border-width.php
CSS border-width property
border-width: medium|thin|thick|length|initial|inherit; ... Set the width of the top and bottom borders to 10px, and the width of the left and right borders to 1px: ... If you want to use W3Schools services as an educational institution, team ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-width
border-width - CSS | MDN
2 weeks ago - This property is a shorthand for the following CSS properties: ... /* Keyword values */ border-width: thin; border-width: medium; border-width: thick; /* <length> values */ border-width: 4px; border-width: 1.2rem; /* top and bottom | left and right */ border-width: 2px 1.5em; /* top | left and right | bottom */ border-width: 1px 2em 1.5cm; /* top | right | bottom | left */ border-width: 1px 2em 0 4rem; /* Global values */ border-width: inherit; border-width: initial; border-width: revert; border-width: revert-layer; border-width: unset;
Discussions

CSS border less than 1px - Stack Overflow
Possible Duplicate: HTML: Sub-pixel border The default border:1px is too big. However, border: 0.5px solid; is not working. Is there a CSS solution that would make the border half the size? More on stackoverflow.com
🌐 stackoverflow.com
Would you understand why I can’t make a border 0.25px thick?
I'm curious, are you gauging your own experience here? I'm a former FE Dev moved UX. You definitely can set something to a fraction of a px unit in CSS.... The calc() function would basically have a fit if fractions of px didn't exist in modern web browsers.... More on reddit.com
🌐 r/UXDesign
68
28
May 24, 2023
How to make border height & width smaller than it's element?
You need to make boxes with a bottom and top padding of some number and then adjust the border so that it only appears on the left and right. Then the long horizontal lines will be the bottom and top border of long horizontal divs containing each data box. Borders only appear on the border of elements but you can adjust margins to make the element distance itself from other elements. You should look up the css box model More on reddit.com
🌐 r/webdev
40
15
July 20, 2022
border-collapse: What am I missing?
border-collapse is meant to collapse borders within tables. I've not seen it used for anything but. You may have luck setting the overall wrapper to display: table; or display: inline-table and each grid item set as display: table-cell; More on reddit.com
🌐 r/css
9
3
December 31, 2014
🌐
W3Schools
w3schools.com › css › css_border_width.asp
CSS Border Width
The border-width property specifies the width of the four borders. The width can be set as a specific size (in px, pt, cm, em, etc) or by using one of the three pre-defined values: thin, medium, or thick:
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
<div class="border-t-4 border-indigo-500 ..."></div><div class="border-r-4 border-indigo-500 ..."></div><div class="border-b-4 border-indigo-500 ..."></div><div class="border-l-4 border-indigo-500 ..."></div>
🌐
GeeksforGeeks
geeksforgeeks.org › css › css-border-width-property
CSS Border Width Property %%page%% %%sep%% %%sitename%% - GeeksforGeeks
July 11, 2025 - The border-width: 5px 10px 15px rule sets the top border to 5px, the right and left borders to 10px, and the bottom border to 15px. This creates varying thickness on different sides of the element.
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.
🌐
TechOnTheNet
techonthenet.com › css › properties › border_width.php
CSS: border-width property
In this CSS border-width example, we have provided four values. The first value of thick would apply to the top of the element. The second value of 10px would apply to the right side of the box. The third value of 12px would apply to the bottom of the box.
🌐
Programiz
programiz.com › css › border-width
CSS border-width Property (With Examples)
/* styles all p */ p { padding: ... { /* sets the border width to thick */ border-style: thick; } ... We can use the border-width property to change the width of one to all four sides of the border....
🌐
DoFactory
dofactory.com › css › border-width
CSS border-width
<style> .border-example-multiple { padding: 15px; border-style: solid; border-color: tomato; border-width: thin thick; } </style> <div class="border-example-multiple"> border-width: thin thick </div> Try it live
🌐
Bootstrap
getbootstrap.com › docs › 5.0 › utilities › borders
Borders · Bootstrap v5.0
Use border utilities to quickly style the border and border-radius of an element. Great for images, buttons, or any other element.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › border
border - CSS - MDN Web Docs - Mozilla
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
🌐
BigBinary Academy
courses.bigbinaryacademy.com › learn-css › borders › border-width
Border Width - CSS | BigBinary Academy
The `border-width` property is used to specify the thickness of the borders. For specifying values, we can use the standard absolute or relative units or we can use values like `thin`, `medium` or `thick`. When this property is not set, a medium border appears by default.
🌐
Telerik
telerik.com › design-system › docs › utils › borders › border-width
Telerik and Kendo UI Border Width Utilities | Design System Kit
The Telerik and Kendo UI Border Width Utilities are a collection of CSS classes that enable you to control the border width of an element.
🌐
TutorialsPoint
tutorialspoint.com › css › css_border-width.htm
CSS - border-width Property
<!DOCTYPE html> <html> <head> <style> ... border has a 'thin' border-width. </p> </div> </body> </html> To set a thick width to the borders, we can use the thick value....
🌐
1Keydata
1keydata.com › css-tutorial › border-width.php
CSS Border-Width Property - 1Keydata CSS Tutorial
The border-width property in CSS defines the width of the border. Visit 1Keydata now to learn CSS.
🌐
Rocket Validator
rocketvalidator.com › html-validation › css-border-width-x-is-not-a-border-width-value
HTML check: CSS: “border-width”: X is not a “border-width” value. · Rocket Validator
The border-width property controls the thickness of a border around an element, and only accepts values such as length units (like 2px, 0.5em, 3pt) or the keywords: thin, medium, and thick.
🌐
CSS-Tricks
css-tricks.com › almanac › properties › b › border
border | CSS-Tricks
February 3, 2023 - This is the link https://www.antennahouse.com/hubfs/xsl-fo-sample/block/axf-border-double-thickness-1.pdf?hsLang=en#
🌐
Tailwind CSS
tailwindcss.com › docs › border-style
border-style - Borders - Tailwind CSS
Use utilities like border-solid and border-dotted to control an element's border style:
🌐
Codecademy
codecademy.com › docs › css › borders › border-width
CSS | Borders | border-width | Codecademy
October 21, 2023 - Set the width of the border top to 10px, right and left to medium and bottom to thick: h1 { border-color: green; border-style: dashed; border-width: 10px medium thick; } Copy to clipboard · Copy to clipboard ·