Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
20 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?
2
votes
1answer
35 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 ...
1
vote
1answer
48 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 ...
2
votes
1answer
56 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 ...
1
vote
0answers
73 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 ...
3
votes
1answer
83 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
1answer
86 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
0answers
43 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 ...
3
votes
1answer
86 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
0answers
36 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 ...
1
vote
2answers
269 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
1answer
50 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
2answers
98 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
2answers
98 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
2answers
828 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
1answer
58 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 ...
5
votes
1answer
126 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 ...
5
votes
2answers
135 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
1answer
126 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 ...
8
votes
1answer
3k 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 ...
5
votes
2answers
294 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> </...
5
votes
1answer
409 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
2answers
701 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
0answers
53 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 ...
0
votes
0answers
826 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
0answers
110 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 ...
3
votes
1answer
4k 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 ...
4
votes
2answers
172 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 ...
6
votes
1answer
1k 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 ...
5
votes
4answers
459 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 HTML ...
6
votes
2answers
3k 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
1answer
165 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/...
7
votes
2answers
3k 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 ...
7
votes
2answers
3k 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-...
7
votes
1answer
6k 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 ...
7
votes
1answer
469 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 ...
4
votes
1answer
1k 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 ...
7
votes
3answers
1k 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 ...
8
votes
1answer
784 views

custom bullets html ebook kindle

I am creating an ebook for Amazon's Kindle in HTML, and then later use KindleGen to convert it into the Kindle's MOBI version. The problem I am currently having is with custom bullets for nested ...
11
votes
1answer
137 views

Is it a good idea to minify code when coding ePubs?

I typically minify my .css file because it's something I am used to when developing websites, but I have seen some people actually minify their .xml files (such as the .ncx, .opf, etc.). I have always ...
11
votes
2answers
4k views

Can custom fonts be embedded in mobi or epub books targeting eink readers?

Assuming that I am targeting non-tablet eBook readers such as Kindle and nook, is it possible to layout a book with some text in the default font of the device and some paragraphs in a special font ...
10
votes
2answers
291 views

When it is better to use plain HTML instead of CSS?

I published a book which contains some (simple) math formulas, like axn+bxn−1+ … + hx + k = 0. Such formulas may be displayed just with (X)HTML, as you may see. However, some friends of mine ...