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.

Filter by
Sorted by
Tagged with
2 votes
1 answer
15 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
0 answers
18 views

How to make images in mobi comic book fullscreen

I’m reading OnePiece recently, but my ereader app cannot display the images full screen, which makes texts too small to read. Mean while, I found that I can write custom css rules to style the book. ...
0 votes
1 answer
55 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 ...
1 vote
0 answers
34 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 (...
1 vote
1 answer
46 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 ...
1 vote
0 answers
245 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 ...
  • 111
1 vote
1 answer
120 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 ...
  • 2,324
2 votes
4 answers
3k 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 ...
  • 131
0 votes
0 answers
668 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 ...
  • 2,324
2 votes
1 answer
76 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 for ...
  • 141
2 votes
2 answers
56 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 ...
  • 2,324
0 votes
1 answer
951 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 ...
  • 1
2 votes
1 answer
757 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?
  • 21
2 votes
1 answer
59 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 ...
  • 121
1 vote
1 answer
112 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 ...
  • 113
2 votes
2 answers
720 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 ...
  • 211
2 votes
0 answers
109 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
1 answer
134 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
1 answer
228 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 ...
  • 647
1 vote
0 answers
82 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 ...
  • 647
4 votes
1 answer
240 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
50 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 ...
  • 647
1 vote
2 answers
785 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 ...
  • 296
3 votes
1 answer
246 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
240 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/...
  • 647
2 votes
2 answers
233 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 ...
  • 647
5 votes
2 answers
2k 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 ...
  • 647
1 vote
1 answer
234 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 ...
  • 647
4 votes
1 answer
398 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 ...
  • 647
4 votes
2 answers
268 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 ...
  • 647
4 votes
1 answer
293 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 ...
  • 229
9 votes
1 answer
7k 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 ...
  • 243
5 votes
2 answers
1k 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> </...
  • 71
6 votes
1 answer
2k 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 ...
  • 163
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
75 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 ...
1 vote
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 ...
  • 11
1 vote
0 answers
164 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
8k 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 ...
  • 2,324
4 votes
2 answers
200 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
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 ...
5 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 ...
7 votes
2 answers
5k 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
284 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/...
  • 742
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 ...
  • 693
8 votes
2 answers
5k 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-...
  • 693
8 votes
1 answer
10k 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 ...
  • 693
8 votes
1 answer
768 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 ...
  • 693
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 ...
  • 693