Questions tagged [css]
`CSS` or "Cascading Style Sheets" is a language for describing the look and formatting of a document. It is often used in web pages or XML.
54 questions
0
votes
1
answer
26
views
Kindle does not display font-style properly, and all other epub readers does
Kindle does not display font-style properly, and all other epub readers does.
I did choose standard font:
.new-font{
font-family: Courier,sans-serif;
}
and used it normally:
<p class=&...
3
votes
1
answer
46
views
How to wrap long lines inside 'pre code' environments, for Kobo
I am trying to build an ebook from a programming tutorial (markdown):
it contains many code blocks with comments; the comment lines are too long for the width of my Kobo H2O v2 reader, so I can't read ...
0
votes
1
answer
266
views
Calibre is changing HTML content while converting
I used Calibre to convert my HTML file to EPUB3 and check it with its viewer
and I notice that a lot of syles are missing !!!!
so I check the created ebook's files using calibre local editor
and what ...
2
votes
0
answers
89
views
Change eBook font doesn't change font for ordered/unordered lists
I've created an ePUB with fonts exported so that when viewed on "Original" (eg in iBooks), you see the same font as the paperback edition of the book. But if you change the font in iBooks (...
2
votes
1
answer
71
views
Alternate covers for different devices and software
Quite new to writing and editing ebooks and I wondered something.
I know in webpages it's possible to produce alternate styling and content based on what the content is being viewed on. So CSS can ...
2
votes
0
answers
711
views
Adding a background image in Calibre
To get a background image in Calibre, I gather that I need to open a book and right click. This will expose a menu. Choosing "Preferences" >> "Styles" opens a GUI to change ...
1
vote
1
answer
179
views
which readers honor -webkit-transform CSS property?
I have got an ebook (in epub format) of a popular Italian series for children. However, I cannot browse it with my usual Android ebook reader (Moon+ Reader Pro) because formatting is quite wrong: for ...
3
votes
4
answers
6k
views
css - select only when followed by specific element
I have a specific problem in which I need to remove the margin-bottom of every Element that has a class only when followed by the same element with the same class.
So p.1 has a margin-bottom:1em to ...
0
votes
0
answers
958
views
Is there an equivalent of TeX's \hfill in CSS?
Subject says it all. I know that I can use float:left and float:right, but this does not work if the combined lenght of texts is more than a line. I would like to have some text anchored to the left ...
3
votes
1
answer
130
views
Publishing in serveral formats: what CSS code to use?
There's the site "Can I use" to show which CSS keyword is compatible with which browser.
But is there the equivalent for books format?
For instance, I'm trying to make several book formats ...
2
votes
2
answers
60
views
How to set the font sizes of two text sections to be relative to each other?
I am editing an ebook, trying to mimic the original format of its text. In the book, footnotes are written in a smaller font with respect to normal text, and so are quotations; this means that a ...
0
votes
1
answer
1k
views
EPUB 3 CSS stylesheet ignored in some cases?
I created a MOBI file using Kindlegen. I fed the MOBI file to Calibre and converted it to an EPUB.
If I view the HTML files I used to create the MOBI file, they look great. All formatting is picked ...
3
votes
1
answer
966
views
Problem with left alignment in Calibre/iBooks
Using Calibre I have tried to use ´text-align: left´ in CSS but viewing the resulting epub-file with iBooks the result is still justified text. How can I change to left alignment?
3
votes
1
answer
69
views
Is it possible to set font-color to the background-color
I want a , but of course, the background in nightmode will appear black (or something close to that). How can I set the css so the big 7 has the same font-color as the background no matter what the ...
2
votes
1
answer
129
views
Does a basic CSS file to produce acceptable documents exist anywhere?
I am currently writing a processor to convert a specific website to EPUB and everything works fine except that the result I get, when read in Calibre does not look very nice I think.
I was looking ...
3
votes
2
answers
1k
views
Keeping a subheading with its first line of text in an epub
I'm converting an InDesign document to Epub. I'm using Microsoft Edge as the epub reader (that might be a mistake...). Edge is open in an approximately 1280x1024 window and is showing two "pages" of ...
2
votes
0
answers
124
views
how to read code part of technical book on kobo
I have many technical ebooks with coding examples but it's unreadable because there's no scrollbar and many lines are longer than my ebook screen.
I have tried to change it in an open ebook by adding ...
4
votes
1
answer
300
views
Move image to top of the page (like LaTeX’s \begin{figure}[t])
Before I start, let me be clear about what I’m not trying to do:
I’m not trying to keep particular text on the same page as an image.
I’m not trying to force a page break before an image.
That said, ...
1
vote
2
answers
276
views
CSS: Spans vs Font Families
I'm using Sigil to create epubs and iBooks primarily to preview them, and I have a recurring CSS problem that's driving me nuts. I'm not really sure if it's just a problem with spans or with a variety ...
1
vote
0
answers
87
views
Removing white background from linked images
My first epub looks fine when viewed in iBooks, but it has a problem in Kindle.
Hyperlinked home page icons have a white background. So a triangular image just looks like a big white square.
I added ...
4
votes
1
answer
327
views
Is it more effective to apply CSS styles to <p> or <body> elements in an ePub?
I'm hand formatting an ebook with Sigil for distribution through Amazon. I've noticed that, while it's most common to place your Text-indent in the CSS of the <p> tag, it also works in the <...
1
vote
0
answers
52
views
Need a Workaround for CSS Overrides
I'm working on an epub in Sigil. Things are going pretty good, but I'm puzzled by some kind of CSS bug.
For example, I want all the fonts in the table of contents section to be sans-serif. So I put ...
2
votes
2
answers
886
views
Can you use CSS to target iOS night reading mode?
Is there a way to target Night mode (or Sepia or Gray mode for that matter) on iBooks with custom CSS? I have decorative elements in my chapter headings that I would like to match with the text colors ...
3
votes
1
answer
295
views
Adding Video links to an ebook
I am new to ebooks and am not really sure of the capabilities of the system. I have written a number of technical books which I was considering turning into video lectures. Now I think it would be ...
1
vote
2
answers
270
views
How can I highlight visited anchors in an epub?
Suppose I insert the following anchor in an epub...
<span id="horse"></span>The first horses in America . . .
Then I insert a link in the index...
Horse, in America, <a href="..Text/...
2
votes
2
answers
290
views
How to alternate row colors of tables in ePub files
Can anyone tell me how to create tables with alternating row colors in an epub? For example, I might want the default background color to be white, but every other row would have a light blue ...
5
votes
2
answers
3k
views
How can I prevent a widowed/orphaned header?
I have a chapter that has brief information for each of the 50 states. Each section begins with a state's name in a h4 tag.
When I preview my book, I sometimes see a header resting on the bottom of a ...
1
vote
1
answer
272
views
Overriding Device Styles
On some epub devices, you can change the background color to black, with the font switching to white. My iBook program allows four distinct styles.
Is there a way to override these styles for ...
4
votes
1
answer
453
views
Can I split chapters with CSS?
I'm learning to create epubs with InDesign. If you want a particular element inside a chapter (e.g. a subheading) to appear at the top of the next page, you can assign it a CSS style that has been ...
4
votes
2
answers
316
views
Should every paragraph tag have a CSS style (InDesign)?
I'm working on my first epub, and I would like to use the following CSS scheme:
Most paragraph tags would have no class assigned and would be styled by a simple rule in the style sheet...
p {}
A ...
4
votes
1
answer
359
views
Table headings that may repeat for several "pages"
I'm writing with Sigil an ebook with several tables, different sizes and extensions.
Is there a code in HTML or CSS to have table headings row to repeat thru several "pages" (depending on how big is ...
9
votes
1
answer
9k
views
Any opensource or free css stylesheets for books?
I am creating epub using sigil. Every book has almost (if not all) same elements: Headings, paragraphs, images, tables, quotes, boxes, notes, footnotes, references, bibliography etc. I don't have a ...
6
votes
2
answers
2k
views
Is it possible to create anchors in the numbers of an <ol> list?
I need a clarification regarding the link creation for <ol> list in the HTML page.
Here is the example code for reference.
<ol>
<li>test</li>
<li>test</li>
</...
9
votes
1
answer
3k
views
Calibre ebook viewer - Apply User Stylesheet to Full Screen Mode
How do I apply styles to full screen mode only via the User Stylesheet?
Specifically, I would like to adjust the body style during full screen mode to adjust margin-left.
I would like to do this ...
4
votes
2
answers
1k
views
Media queries to distinguish between Kindle e-inks vs non-e-inks
I would like to separate styles (colors) for e-ink Kindles and the rest. It could be quite easy if monochrome or color queries worked. As far as I know, I have to use a workaround. It is said Kindle ...
2
votes
0
answers
108
views
How well does Google Play Books support page-oriented css? (i.e., page breaks)
While testing ebooks, I have been finding deficiencies in css support in Google Play Books.
Namely, this doesn't work:
h2 {
page-break-before: always;
}
GPB's support for embedded ...
3
votes
0
answers
2k
views
Setting default ePub font in iBooks
I acquired a sample epub file from a client to use as a template for new epub files. When I open this file in iBooks (v 1.0.1), the paragraph text by default has the font Iowan, and the style ...
1
vote
0
answers
177
views
landscape orientation in ereaders: css for both 1 and 2 page layout?
I'm trying to write css media queries for landscape and portrait orientations.
With widths of 1024 pix and wider, you think that 1024 pixels is enough to have 2 columns instead of 1.
But does any ...
7
votes
1
answer
9k
views
footnote as popup in epub
In an ebook I bought, if you click on the number of a footnote the text of the note appears as a popup, and you may choose to close the popup or go to the chapter with footnotes. I noticed this ...
5
votes
2
answers
211
views
How do I build multiple ebooks using common blocks of content and styling, such as title pages and CSS?
I work in a university program with around 30 units, each of which produces a learning guide of 80 to 120 pages. Currently we supply them as pdf files, but I want to move to an epub (HTML/CSS) based ...
7
votes
1
answer
2k
views
What CSS can I use to change the background color of an epub on a Nook HD?
I'm having a really hard time changing the background color of my epub on the Nook HD.
I've tried doing:
body {
background-color: red;
}
(Not that I would actually use red, I just want to see a ...
6
votes
4
answers
2k
views
How to hide/delete/ignore a specfic span type
I am generating HTML output for ePub from LaTeX source.
But, am having difficulty eliminating the "Chapter " at the start of each chapter. So, wondering if there is an easy way to tell the ...
8
votes
2
answers
6k
views
Moon+ Reader -- what kind of CSS support? formatting tips?
A friend recommended Moon+ Reader for android and I was initially impressed by all the features and controls.
Then I checked how my own published books render in Moon+. I saw lots of weird things. ...
4
votes
1
answer
372
views
Content Property in EPUB 2
I am working with EPUB 2 specifications and I am trying to determine whether or not the content property is supported in EPUB2. I know that it is for EPUB 3 - http://www.idpf.org/accessibility/...
10
votes
2
answers
4k
views
Body Text Formatting and Text Indentation for Kindle eBooks
I am currently creating an ePUB3 file for converting it to Kindle format, and for it be compatible to other ereading devices that support epub.
I was confused about whether Kindle allows the font ...
8
votes
2
answers
6k
views
Setting up margins in ePUB and Kindle ebooks and @page rule
I am currently creating an ePUB3 file for converting it to Kindle format, and for it be compatible to other ereading devices that support epub.
I noticed a directive in the css file of one of the DRM-...
9
votes
1
answer
11k
views
Centering images and text in ePUB and Kindle ebooks
I am currently creating an ePUB3 file for converting it to Kindle format, and for it be compatible to other ereading devices that support epub.
For centering images and groups of text, I am using ...
8
votes
1
answer
906
views
How can I toggle text reliably across all ereaders in an epub file?
I'm trying to make a multilingual ebook where I have two different translations of the same story. I'm trying to get it so that you can toggle the language by clicking on individual paragraphs. I ...
5
votes
1
answer
3k
views
Formatting Table of Contents in epub using HTML TOC or Logical TOC and how to include TOCs in <spine>
I am trying to create an epub file (in epub 3), and will be using KindleGen to convert it into kindle's mobi format. At the moment I was working on the table of contents files, and there were a few ...
8
votes
3
answers
2k
views
Is there a detailed guide for creating an ebook for Kindle in HTML/CSS
I want to be able to create an ebook on my own for Kindle. I want to do this in HTML, and then later use KindleGen and KindlePreviewer for generating a .mobi file and previewing. I've looked around ...