Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 10-04-2022, 07:33 PM   #1
irrationalpie
Junior Member
irrationalpie began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2019
Device: Kindle PW3
Question Apply styling to header/footer

The "Styles" page of the viewer preferences mentions there are custom classes for different flow modes, e.g. body.calibre-viewer-paginated and body.calibre-viewer-scrolling. Are there specific classes or ids associated with the headers and footers? I would love to be able to style them specifically, although setting a minimum font size in preferences did fix my main complaint, which is that they were microscopically small on my laptop. I tried looking on github to see how the viewer constructs things, but although I saw references to e.g. something that looked like it could be a 'book-side-margin' class, I couldn't get that to do anything.

After I experimentally tried overriding all text and background colors, I suspect the style sheet may simply not apply to the headers and footers, which might explain why they're in a sans-serif font despite my preference saying to use serif font. Although at least the background/foreground color respects my custom color preferences.
Code:
* {
color: black !important;
background-color: white !important;
border-style: dotted !important;
}
This screenshot shows "Chapter 1" (part of the heading) in my normal custom font/background color, with the text below in black and white as per the experiment stylesheet.
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2022-10-04 16-22-03.png
Views:	367
Size:	26.0 KB
ID:	196986  
irrationalpie is offline   Reply With Quote
Old 10-04-2022, 11:35 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The stylesheet does not apply to headers and footers, only to book content. Headers and footers are shown in the UI font, not the book text font, since that would be pretty confusing.
kovidgoyal is offline   Reply With Quote
Advert
Old 10-05-2022, 01:27 AM   #3
irrationalpie
Junior Member
irrationalpie began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2019
Device: Kindle PW3
Quote:
Originally Posted by kovidgoyal View Post
The stylesheet does not apply to headers and footers, only to book content. Headers and footers are shown in the UI font, not the book text font, since that would be pretty confusing.
I guess that makes sense. In my mental model, I was thinking of the header and footer as belonging to the book, like a page number or chapter title that's on each written page, so I expected to be able to style it like I was styling the rest of the page. Don't get me wrong, I like the fact that the header and footer apply my custom background and foreground color--it would be rather jarring to have them in a totally different brightness level, the way the toolbar is--but I think that contributed to my confusion. Thanks for explaining!
irrationalpie is offline   Reply With Quote
Old 10-05-2022, 01:31 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Indeed in an ebook unlike a pbook headers and footers belong to the reader not the author
kovidgoyal is offline   Reply With Quote
Reply

Tags
css, footer, header, stylesheet


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sage Header and Footer space mcp000 Kobo Reader 10 09-08-2022 04:37 PM
Footer or Header? shore_pk Sigil 10 04-23-2021 11:43 AM
How to add a header/footer Arkadian Editor 7 09-24-2014 02:28 PM
Header and Footer in EPUB Raja1205 ePub 7 08-29-2012 02:36 AM
Header/Footer removal Solicitous Calibre 2 03-30-2010 05:53 AM


All times are GMT -4. The time now is 02:45 AM.


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