On Mobile Safari on an iPhone 4 or iPhone4S, can you have a border of a div that is 0.5px wide?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- Safari blocks play() on video despite being called
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- What is the definition of HTTP_X_PURPOSE?
Apple added support for this in OSX Yosemite and iOS 8.
Also I've found this method working (iOS7):
I'm not sure what you mean exactly. If you are asking if you can draw a border of 1 px on an iPhone 4 which would be 1/2 the physical size of the border on an iphone3G, then yes. CoreGraphics uses points instead of pixels. As you can see by the following method, you can specify a float:
Since 1point != 1px, you can specify 1px on an iPhone4 by specifying 0.5point.
Read up on it here
I wrote an overview of different techniques:
Half-pixel border
Cons:
border-image
border.gif is a 6×6 pixel image:
Pros:
Cons:
Multiple background images
“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:
Scale up and down
Mentioned here already by Priit Pirita.
Yes. Use scale. The style below will give you hairline
When you need all sides, then the best way is to repliacte the DIV with :after or :before CSS pseudoclass, apply border to that pseudoclass, make it twice the size and then scale it with transform:scale down to half.
More specificly (and all those tricks in use too) here http://atirip.com/2013/09/22/yes-we-can-do-fraction-of-a-pixel/
Sharing a SASS/SCSS + Compass mixin I wrote and I've been using:
CSS example: