![]() |
#1 |
Connoisseur
![]() Posts: 69
Karma: 10
Join Date: Jul 2023
Device: none
|
Units and dimensions
When should I use which units for dimensions, e.g. should fonts be pt, em, px, in, ... ? What about margins or images?
|
![]() |
![]() |
![]() |
#2 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,329
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
This question has been addressed many times. You should be able to find multiple responses if you search the MR forum.
In general, use em for fonts/margins/indents so they are resizable by the user and maintain relative size with other items on the page... However, many advocate not specifying any size (in any dimension) for those at rely on the user setting. I think it depends on the device used by your target market, and prefer to set a default size that the user can then override if they desire. I highly advise against using any fixed size units (pt, px, in, etc.) as that looks absolutely horrible on anything except the device you are using when coding the ePub... eg if the user has a different size display or they use a different font size, etc. I also tend to use % (or vh & vw) when defining image sizes or trying to limit an element based on the screen size or Viewing Height/Width. Cheers, Last edited by Turtle91; 03-25-2025 at 08:26 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,415
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
If you need the eBook to be ePub2 compatible, do not use vh or vw as they are not ePub2 compatible.
|
![]() |
![]() |
![]() |
#4 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,329
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Your statement is not true. You simply need to use fallback coding. Code:
CSS: img { width:90%; width:90vw; } This is how CSS works, Jon. Please stop intentionally telling people things you know are incorrect. |
|
![]() |
![]() |
![]() |
#5 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,338
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
But what if your renderer is so borked that it does not ignore unsupported CSS?
Sorry but couldn't help myself. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,329
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
![]() Well, the current method (and reason we see 2 css files on many ePubs…thanks ADE) is to put the newer coding on a different style sheet…. If the device is so borked that it ignores the entire sheet then it still falls back to the older coding on the other sheet! Users of those borked devices should get a refund for false advertising, as they are NOT meeting the ePub standard! Lol To be fair to ADE they realized they screwed up and fixed that problem in their newer version… but they should update the software on those outdated, “borked”, devices. Last edited by Turtle91; 03-26-2025 at 02:20 AM. |
|
![]() |
![]() |
![]() |
#7 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,415
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Your comment does make a sense. |
|
![]() |
![]() |
![]() |
#8 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,415
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,329
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
|
![]() |
![]() |
![]() |
#10 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,939
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#11 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,329
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Not ignoring, just not giving examples to cover every situation. The simple example I gave shows the concept of using css properties and techniques to code for different devices. There are other techniques, such as the multiple css sheets to cover for ADE’s non-compliant issues, or devices that gag on a particular sheet. Other techniques that have been addressed on other threads discuss using techniques like @media queries or @supports queries or even JavaScript to link the appropriate css file at runtime based on the capabilities of the device.
There are ways to overcome most of these issues. However, as DNSB mentioned, if your device is soooo borked up that it can barely turn itself on, let alone meet the ePub2 specification, then there really isn’t a need to code for them anymore. Keeping coders from using the current spec because someone, somewhere, might have a Frankenstein device that can’t run it is not logical. Besides, my biggest point here is keeping the MR readers from giving up on finding a solution just because Jon doesn’t think anything exists beyond ePub2… there are solutions to 98.9% of these issues… Last edited by Turtle91; 03-26-2025 at 05:16 PM. |
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,666
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
No, you didn't understand what Turtle91 wanted to say; in fact, the technique described by him is the best to deal with the ADE bug for epub2 ebooks. You need to employ TWO stylesheets; one of them is ONLY for ADE properties, the other one is for properties supported for Webkit/Readium ereaders. When ADE finds one property in the stylesheet for Webkit/Readium that doesn't like it, it will fully ignore THAT stylesheet BUT NOT ALL STYLESHEETS; the .css with ADE properties still will be honored by ADE. Watch the epub I attach and the .css I include; try opening it in ADE 2.x and in any other ereader not based on RMSDK; you'll understand better what I want to explain
|
![]() |
![]() |
![]() |
#13 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,415
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Last edited by JSWolf; 04-03-2025 at 02:43 PM. |
|
![]() |
![]() |
![]() |
#14 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,329
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Read the thread.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sage Total Dimensions | jerryleejr | Kobo Reader | 3 | 03-20-2022 12:59 AM |
Image dimensions | eBookNoir | Barnes & Noble NOOK | 2 | 02-14-2011 03:22 PM |
PRS-300 Actual Screen Dimensions | jagfan | Sony Reader | 1 | 02-07-2010 02:09 PM |
Thumbnail Dimensions? | Halk | Bookeen | 2 | 11-29-2009 12:32 PM |
dimensions? | fishcube | Sony Reader | 1 | 10-15-2007 12:32 AM |