amalthia: (Doctor Who)
Amalthia ([personal profile] amalthia) wrote in [community profile] fanfic_ebooks2010-09-17 08:30 pm

CSS Override Code

This post is to help anyone who'd like to modify the style or look of the epubs downloaded at the A03 Archive.

I made a new "Extra CSS" code to use in Calibre to convert the A03 epubs to epub. I also found out how to remove underlines on the Chapter links and turn the font back. The purpose of the reconverting is to remove the blank paragraph space and replace it a indent at the start of a new paragraph. During the tests I also found out how to remove the underline on the Chapters so it looks more like a heading and less like a link. That was something I found kind of neat because the links still work. :) But they don't look like links.

Here is the code:

body { margin: 0; }
a {text-decoration: none; color: black;}
a [href] {text-decoration: none; color: black;}
p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt; text-indent: 15pt; text-align: justify;}
h1 { text-align: center;}
h2 {text-align: center; }
h3 { text-align: center;}
h4 { text-align: center; }
h5 { text-align: center; }
h6 { text-align: center; }

And here's more information on the Look and Feel section of Calibre.

I've found that converting epub2epub gave me the best results.

I wasn't sure if I was the only one that preferred indents over the space but just in case I thought I should share.
ext_1951: (Default)

[identity profile] mremre.livejournal.com 2010-09-18 10:11 am (UTC)(link)
ILU! ::grabby hands::

Now if only more epic fic is reposted on AO3... =)
ext_1951: (Default)

[identity profile] mremre.livejournal.com 2010-09-18 10:44 am (UTC)(link)
Oh! http://www.tthfanfic.org has a download ePub function too... do you have any advice on converting that? It comes in a zipfile of HTML chapter files... Is that reformattable? How does that work?

[identity profile] thedorkygirl.livejournal.com 2011-02-19 11:58 am (UTC)(link)
Couldn't you replace your CSS with "br br" -- that worked for me when I played with CSS in high school

[identity profile] thedorkygirl.livejournal.com 2011-02-20 03:09 pm (UTC)(link)
I would make it exactly like this

p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt; text-indent: 15pt; text-align: justify;}

br br {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt; text-indent: 15pt; text-align: justify;}

The first to get any paragraph codes standing alone. The second to get the line breaks being used as paragraph codes (which is what most wordpad to html programs like to do -- the olders ones I used, at least, ten years ago; it's been that long since I've played with CSS, or nearly!!)

[identity profile] thedorkygirl.livejournal.com 2011-02-20 03:11 pm (UTC)(link)
Also you don't need the a [href] because there's no difference there between it & the main attribute; you should be able to cover all link codes with just the a attribute alone. Unless for some reason there is a glitch that I don't know/can't see.

[identity profile] thedorkygirl.livejournal.com 2011-02-20 03:12 pm (UTC)(link)
...such as a style difference in the primary CSS page, derrr!

[identity profile] thedorkygirl.livejournal.com 2011-02-22 01:39 am (UTC)(link)
I'm not sure - you'll have to play around. I haven't messed about with a website in about five years :)

[identity profile] thedorkygirl.livejournal.com 2011-02-22 01:44 am (UTC)(link)
I'm assuming that you can make a basic HTML document & CSS page and link the two?

[identity profile] haikitteh.livejournal.com 2010-09-18 04:20 pm (UTC)(link)
Thank you so much! I also prefer indents to the space. I'm usually pretty incompetent with Calibre beyond the most rudimentary commands, but I'm going to give it a whirl!

[identity profile] whispersecho.livejournal.com 2010-10-30 01:15 am (UTC)(link)
You seem to have a handle on the Calibre css... I've been trying to re-format .pdf files into .epub and it's not playing nice. What I'd like it to do:
-NOT put a blank line between *each* paragraph (eg I don't want internet/fanfic formatting where each paragraph starts not-indented with a blank line between)
-indent each paragraph (EXCEPT the first of a new chapter, or after a "double return" {ie blank line between one paragraph and the next}),
-be able to selectively "blockquote" sections (inset right and left, and control font size)

What it *actually* does:
-indent each paragraph, but remove spacing between *all* paragraphs including places where it 'changes scene/location' and needs a space

I haven't been able to effectively "blockquote".
And, of course, there's just some rather bad formatting of the original PDFs.

Any help would be SPECTACULARLY appreciated.
Thanks!