![]() |
#1 |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
Code:
h2 {text-decoration: underline; } |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 | |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,726
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
h2 {text-decoration: underline; } 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. |
|
![]() |
![]() |
![]() |
#8 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
|
![]() |
![]() |
![]() |
#9 |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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; } Is there a Firefox EPUB reader plugin that supports underlining that is ADE-based? Thank you. |
![]() |
![]() |
![]() |
#10 |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.) |
![]() |
![]() |
![]() |
#11 |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> 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. |
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#13 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |