On Mobile Safari on an iPhone 4 or iPhone4S, can you have a border of a div that is 0.5px wide?
I wrote an overview of different techniques:
border: 0.5px solid black;
Cons:
border-width: 1px;
border-image: url(border.gif) 2 repeat;
border.gif is a 6×6 pixel image:
Pros:
Cons:
background:
linear-gradient(180deg, black, black 50%, transparent 50%) top left / 100% 1px no-repeat,
linear-gradient(90deg, black, black 50%, transparent 50%) top right / 1px 100% no-repeat,
linear-gradient(0, black, black 50%, transparent 50%) bottom right / 100% 1px no-repeat,
linear-gradient(-90deg, black, black 50%, transparent 50%) bottom left / 1px 100% no-repeat;
“How to target physical pixels on retina screens with CSS” describes how to draw a line. Draw 4 lines and we have a border.
Pros:
Cons:
Mentioned here already by Priit Pirita.