Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-17-2014, 01:51 AM   #1
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,185
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
CSS <body> vs. <p> question

Hi,

For the longest time I've been specifying a font size in my <P> tag in the css override box, and I'm not sure if I should have been adding it to the <body> tag instead?

What brings this up is that I'm using the Fanfiction Downloader plugin and the source files it converts sometimes don't have a <p> tag at the start of the paragraph. In fact, some of these stories have zero tags at the beginning of the sentence, as a result the text is small and hard to read.

However, I'm not sure how to code for sentences that have no html coding tags to use?

I thought adding the font size to the body tag would fix these types of paragraphs, however before I made a change like that I'd like to know if anyone else adds the font size into their css override body tag? Are there side effects? or does it work just like the paragraph tag? or does the body tag font mess up heading sizes?

I'd appreciate any and all help.
Amalthia is offline   Reply With Quote
Old 01-17-2014, 02:04 AM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
If you change the font size in the body tag, then everything within the body tag will inherit that size. Unless overridden by more specific css later on.

http://www.webdesignfromscratch.com/...tance-cascade/

font-size IS an inherited attribute.
eschwartz is offline   Reply With Quote
Advert
Old 01-17-2014, 02:49 PM   #3
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,185
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by eschwartz View Post
If you change the font size in the body tag, then everything within the body tag will inherit that size. Unless overridden by more specific css later on.

http://www.webdesignfromscratch.com/...tance-cascade/

font-size IS an inherited attribute.
Thank you for the link. I will have to look at my settings and see if font sizes are mentioned anywhere else.

I think the confusing part is that I'm using two different areas to convert ebooks, one is the default Calibre conversion and the other is Fanfiction Downloader conversion settings.

In the Calibre conversion settings I do not have font size listed in my css override codes because it's not needed. In FFDL, I need to specify a font size. Though, maybe that has changed. I will run some tests.
Amalthia is offline   Reply With Quote
Old 01-17-2014, 10:09 PM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You might be looking at this in the wrong way.

If the code doesn't have p tags to indicate the paragraph, what does it have? Does it use two br's? Or something else? If it is br's, then adding the option "replace_br_with_p: true" into the personal.ini for the site might help. Otherwise, I suggest mentioning it in the FFDL thread might prompt a suggestion or a fix to the downloaded for the site.
davidfor is offline   Reply With Quote
Old 01-20-2014, 12:12 PM   #5
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,185
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by davidfor View Post
You might be looking at this in the wrong way.

If the code doesn't have p tags to indicate the paragraph, what does it have? Does it use two br's? Or something else? If it is br's, then adding the option "replace_br_with_p: true" into the personal.ini for the site might help. Otherwise, I suggest mentioning it in the FFDL thread might prompt a suggestion or a fix to the downloaded for the site.
That is the problem with some of these stories there is no code at the start of the paragraph.

for example the author would have:
Quote:
<p>*****</P>
start of paragraph here

<p>new paragraph.
I don't think the "replace_br_with_p: true" option can fix this.
Amalthia is offline   Reply With Quote
Advert
Old 01-20-2014, 01:33 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Amalthia View Post
That is the problem with some of these stories there is no code at the start of the paragraph.

for example the author would have:


I don't think the "replace_br_with_p: true" option can fix this.
OMG
not only:

The mark opens with a lowercase p and closes with an uppercase /P
theducks is online now   Reply With Quote
Old 01-20-2014, 10:05 PM   #7
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Amalthia View Post
That is the problem with some of these stories there is no code at the start of the paragraph.

for example the author would have:


I don't think the "replace_br_with_p: true" option can fix this.
I agree with theducks, that's bad. It would be interesting to know what the original source looked like. As it might be something they can fix in the FFDL adapter for the site, I would report it on the FFDL thread with a link to a story or two that has the problem.

Or you can fix the code yourself. The following regex should find them these problems:

Code:
(<p>\*.*)</P>(\s+)(\w+.*)(\s+<p>)
and the replace string is:

Code:
\1</p>\2<p>\3</p>\4
I tested that with what you posted and it should work if they are all like that.
davidfor is offline   Reply With Quote
Old 01-21-2014, 01:50 AM   #8
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,185
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by davidfor View Post
I agree with theducks, that's bad. It would be interesting to know what the original source looked like. As it might be something they can fix in the FFDL adapter for the site, I would report it on the FFDL thread with a link to a story or two that has the problem.

Or you can fix the code yourself. The following regex should find them these problems:

Code:
(<p>\*.*)</P>(\s+)(\w+.*)(\s+<p>)
and the replace string is:

Code:
\1</p>\2<p>\3</p>\4
I tested that with what you posted and it should work if they are all like that.
I haven't had problems with the <p> tag whether it's uppercase or lowercase...

I can post something at the FFDL thread to see if there is a way to find these orphan paragraphs and add some paragraph tags to them because I've seen it on many stories.

currently, switching to using the font-size in the <body> tag has seemed to fix the problem.
Amalthia is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
force an addition to main body css ? cybmole Conversion 5 01-17-2014 02:35 AM
Adding body style to Extra CSS does nothing Barty Conversion 7 10-23-2013 11:06 PM
How to change the font-size in the body tag in css? naisren Conversion 2 10-01-2012 05:52 PM
CSS question crutledge Workshop 17 12-17-2011 07:52 AM
CSS Question AppleTard Calibre 1 06-12-2011 12:07 AM


All times are GMT -4. The time now is 09:05 PM.


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