Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-02-2015, 04:53 PM   #1
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
How to underline all <h2> tags?

I started trying to change the formatting in CSS to make all <h2> tags underlined, but I'm using EPUB2 readers, and the text-decoration command is for CSS3, and EPUB3.

So, is there another way to automatically underline all <h2> rules without having to change the actual XHTML?

Thanks.
crankypants is offline   Reply With Quote
Old 12-02-2015, 07:22 PM   #2
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,047
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 crankypants View Post
I started trying to change the formatting in CSS to make all <h2> tags underlined, but I'm using EPUB2 readers, and the text-decoration command is for CSS3, and EPUB3.

So, is there another way to automatically underline all <h2> rules without having to change the actual XHTML?


Thanks.
In the CSS
Code:
h2 {text-decoration: underline; }
theducks is offline   Reply With Quote
Advert
Old 12-03-2015, 03:39 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by crankypants View Post
I started trying to change the formatting in CSS to make all <h2> tags underlined, but I'm using EPUB2 readers, and the text-decoration command is for CSS3, and EPUB3.

So, is there another way to automatically underline all <h2> rules without having to change the actual XHTML?

Thanks.
The text-formatting was actually already present in CSS1 (see also here). They redefined it for CSS3, but it works fine in ePUB2.
Toxaris is offline   Reply With Quote
Old 12-03-2015, 07:04 AM   #4
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
Quote:
Originally Posted by Toxaris View Post
The text-formatting was actually already present in CSS1 (see also here). They redefined it for CSS3, but it works fine in ePUB2.
So it must be my ereaders then? I use Moon Reader Pro for Android and EPUBReader on Firefox/Windows 7. Has anyone gotten text-decoration to work on Moon Reader Pro or EPUBReeader for Firefox?
crankypants is offline   Reply With Quote
Old 12-03-2015, 07:48 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Are you sure there are no errors in your stylesheet? Does it look similar as the example Doitsu posted?
Toxaris is offline   Reply With Quote
Advert
Old 12-03-2015, 08:29 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Moon+ Pro essentially ignores the CSS in your book and applies its own instead. Try an ADE-based viewer.
HarryT is offline   Reply With Quote
Old 12-03-2015, 08:53 AM   #7
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,726
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by crankypants View Post
So it must be my ereaders then? I use Moon Reader Pro for Android
The current version of Moon+ Reader for Android actually supports:

Code:
h2 {text-decoration: underline; }
If it doesn't work, you've most likely forgotten to link the stylesheet in Sigil

Quote:
Originally Posted by crankypants View Post
EPUBReeader for Firefox?
EPUBReader for Firefox has only minimal ePub2 support and is ill-suited for testing ePub books.

For testing purposes, you may want to install Bluefire Reader for Android, because it uses the same ADE/RMSDK engine that the default apps of most eInk epub readers are based on.

IMHO, underlining headings is a bad idea, because many readers might assume that underlined headings are back-linked to the TOC.

Of course, if you back-link headings, they'll be automatically underlined (without a CSS rule).

Last edited by Doitsu; 12-03-2015 at 09:01 AM.
Doitsu is offline   Reply With Quote
Old 12-03-2015, 11:02 AM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by Doitsu View Post
IMHO, underlining headings is a bad idea, because many readers might assume that underlined headings are back-linked to the TOC.
Agreed. "Underline = hyperlink" is too ingrained in people now.
HarryT is offline   Reply With Quote
Old 12-03-2015, 12:19 PM   #9
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
Here's my style sheet in a CSS file:

Code:
/* HTML tags */
h1 {text-align:center;}

h2 {text-decoration:underline;
    text-decoration-style:solid;
}

h4 {text-decoration:underline overline;
    text-decoration-style:solid;
}
I'm not using Sigil, I'm using a program called Mkepub that I created. The CSS stylesheet is in the EPUB. My first test is to test with the EPUB wiht EPUBreader, but underlines are not showing.

Is there a Firefox EPUB reader plugin that supports underlining that is ADE-based?

Thank you.
crankypants is offline   Reply With Quote
Old 12-03-2015, 12:38 PM   #10
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Things to try:

1. Unzip the EPUB and open the relevant page in Chrome. (If Chrome doesn't show the underlining, then neither will many eBook readers, as many readers are based on WebKit, and Chrome is based on Blink, which forked from WebKit.)
2. Run CSSLint on the CSS file. (If the CSS file contains any actual parsing errors, many eBook readers—particularly those based on ADE/RMSDK—will ignore the stylesheet entirely.)
3. Run a validator on the EPUB. (And if the EPUB doesn't validate, many eBook readers will keel over.)
dgatwood is offline   Reply With Quote
Old 12-03-2015, 12:46 PM   #11
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
Well, it appears the XHTML files do not include the CSS files. I thought the ereader handled that. Here's a sample XHTML header.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>My Test Title</title>
</head>
<body>
I will have to put a reference to the CSS file in each XHTML file now thten get back to you all.

EDIT: Yep, that was it. I forgot to add the style sheet to each XHTML file, since I'm making my own program. EPUBreader supports solid underlines, dashed, dotted, and 'underline overline'. I haven't tested anything else yet. It also supports 'text-align:center' for centering.

New hdr in every XHTML file:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>My Test Title</title>
<link rel="stylesheet" type="text/css" href="../styles/style01.css"/>
</head>
<body>

Thank you!

Last edited by crankypants; 12-03-2015 at 01:15 PM.
crankypants is offline   Reply With Quote
Old 12-03-2015, 01:15 PM   #12
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
The reader cannot handle that, since there may be multiple stylesheets which can be used in different XHTML files.
Toxaris is offline   Reply With Quote
Old 12-03-2015, 01:17 PM   #13
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by Toxaris View Post
The reader cannot handle that, since there may be multiple stylesheets which can be used in different XHTML files.
... And all this stuff originated with websites, where the CSS could be quite literally anywhere!
HarryT is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Useless without underline Quetzalcoatlus EPUBReader 0 04-12-2014 01:30 AM
Image links without underline slicknick001 Kindle Formats 17 12-20-2013 07:16 AM
Underline magavi Devices 5 06-21-2013 01:08 PM
Colored quotes -> underline Coruscatus Conversion 3 11-18-2012 07:30 PM
Amazon Tags - Popular tags vs Unique tags. chrisanthropic Writers' Corner 6 09-19-2011 11:18 PM


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


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