Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Apple Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 05-30-2022, 09:10 PM   #1
Cepheus
Member
Cepheus began at the beginning.
 
Cepheus's Avatar
 
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???
Cepheus is offline   Reply With Quote
Old 05-31-2022, 07:14 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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;
}
JSWolf is online now   Reply With Quote
Advert
Old 05-31-2022, 10:56 AM   #3
Cepheus
Member
Cepheus began at the beginning.
 
Cepheus's Avatar
 
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?
Cepheus is offline   Reply With Quote
Old 06-02-2022, 10:19 PM   #4
cedhax
Addict
cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.cedhax ought to be getting tired of karma fortunes by now.
 
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.
cedhax is offline   Reply With Quote
Old 06-08-2022, 12:33 AM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,603
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Cepheus View Post
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?
Order of evaluation? I've seen issues where some renderers seem to evaluate the stylesheet entries in different orders. I would suggest creating a differently named CSS entry without the border entry and see how it behaves. E.g.:

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;
}
DNSB is offline   Reply With Quote
Advert
Reply

Tags
css, ipad


Forum Jump

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


All times are GMT -4. The time now is 06:51 AM.


MobileRead.com is a privately owned, operated and funded community.