05-30-2022, 09:10 PM | #1 |
Member
Posts: 18
Karma: 10
Join Date: Mar 2019
Device: Kindle
|
CSS works differently on desktop vs iPad
I have created an eBook with a number of chapters containing a graphic at the beginning of each with the following CSS for style:
div.epigraph-facing div.mediaobject img { margin: 1em auto; width: auto !important; height: auto; text-align: center; padding: 0; border: 2px solid black; } One chapter uses a different image at the beginning and should not have a border. I have written the following CSS for to target that specific image. div.epigraph-facing div.mediaobject img[src="images/e_MapOfLincoln.png"] { border: none !important; } This CSS turns off the border to the specific image when I open the book in iBooks on my desktop computer. Unfortunately when I open the eBook in iBooks on my iPad the border is still there. Is there any explanation for why the border is still there on the iPad??? |
05-31-2022, 07:14 AM | #2 |
Resident Curmudgeon
Posts: 76,491
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The border is still there because you specified the border. Try this code and see how you get on.
Code:
div.epigraph-facing div.mediaobject img { margin-top: 1em; margin-bottom: 1em; text-align: center; text-indent: 0; } |
Advert | |
|
05-31-2022, 10:56 AM | #3 |
Member
Posts: 18
Karma: 10
Join Date: Mar 2019
Device: Kindle
|
Thanks for the response JSWolf. In the first CSS statement I did specify the border. This is for the 20 or so chapters that use the same image. The second CSS statement is for a specific image that should not have a border:
div.epigraph-facing div.mediaobject img[src="images/e_MapOfLincoln.png"] { border: none !important; } Not sure why but that image does not have a border when viewed on iBooks on the desktop but does have a border when viewed on the iPad. Any thoughts why that is happening? |
06-02-2022, 10:19 PM | #4 |
Addict
Posts: 283
Karma: 1546488
Join Date: Jan 2016
Device: ipad
|
Typically, EPUB reader apps, including iBooks or Apple Books, render HTML/CSS/Javascript by using a web browser component bundled with the operating system such as macOS or iOS. Thus, the difference you observed may be due to the difference in the system web browser component on macOS and iOS. It may also be due to different version numbers.
One way to explore the issue is to view individual HTML files with Safari browser running on macOS and iOS respectively. If both sets of results are the same, then the bug is probably with the app. Otherwise, it's likely to be the OS. Moreover, try it with a different ebook reader app to see what results you'll get. |
06-08-2022, 12:33 AM | #5 | |
Bibliophagist
Posts: 40,603
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Code:
div.epigraph-facing div.mediaobject img { margin: 1em auto; width: auto !important; height: auto; text-align: center; padding: 0; border: 2px solid black; } div.epigraph-facing div.mediaobject2 img { margin: 1em auto; width: auto !important; height: auto; text-align: center; padding: 0; border: none; } |
|
Advert | |
|
Tags |
css, ipad |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Transfer books from desktop to iPad wirelessly. | Rsdonovan | Devices | 1 | 10-24-2012 12:29 PM |
Kobo Desktop App Never Works...Should I Stop Using It? | pokee | Kobo Reader | 17 | 10-13-2011 06:13 PM |
iPad TiVo Desktop Software with iPad profile | kjk | Apple Devices | 0 | 06-11-2010 03:16 PM |
iPad iPad Desktop Stand Available | Fabe | Apple Devices | 7 | 04-19-2010 05:55 AM |
Firmware Update 2.3 Issues and New Kindle Works Differently! | FredUruncle | Amazon Kindle | 17 | 12-06-2009 05:41 PM |