02-20-2011, 11:49 AM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
half a pixel in css ?
i am looking at source for a book where css has entries like
p { margin-top:4.5px; margin-bottom:4.5px; } if px = pixel then how is half a pixel implemented - makes no sense to me why would anyone code in fractions of a pixel ? |
02-20-2011, 11:54 AM | #2 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Surprisingly, a pixel might be something different than a pixel:
Normally, the pixel unit refers to physical pixels of the viewing device. However, if the pixel density of the output device is very different from that of a typical computer display, the user agent should rescale pixel values. From the CSS3 spec |
Advert | |
|
02-20-2011, 12:03 PM | #3 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
thanks for the link & the explanation - it's not clear what they consider to be a low resolution screen though as they give no screen size examples.
thus I am none the wiser as to what 0.5px actually translates to a) on my Kindle screen b) on my 1920x1200 pc screen. Another reason to avoid px & stick with em measurements, I think! though I have to admit that the book with the 4.5px borders looks good on both screens! |
02-20-2011, 01:17 PM | #4 | |
Well trained by Cats
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
em is a scaled measurement. If you Zoom , em values scale. |
|
02-23-2011, 02:18 PM | #5 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
A pixel is fixed for most monochome devices but on a color device a pixel is really a color triad or in the case of e-Ink a color quad consisting for a 2x2 array. In these cases a sub-pixel is defined to be used for anti-aliasing and other tasks so a .5 pixel would make sense for color devices.
Dale |
Advert | |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
epub CSS versus "Regular" CSS | konrad | ePub | 4 | 02-18-2011 09:29 AM |
css pseudo elements and adjacent combinators in extra css? | ldolse | Calibre | 2 | 12-21-2010 05:09 PM |
Pixel Qi | Balerion | Amazon Kindle | 8 | 08-14-2010 04:53 PM |
Pixel Qi update | jerome | News | 1 | 06-01-2010 01:35 PM |
half of my screen is blank and the other half is stuck in the USB condition. | modsoul | Sony Reader | 1 | 11-04-2007 10:03 AM |