![]() |
#1 |
Village idiot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
|
font-size headings
Dear all
In the CSS of my epubs, I didn't set font-size for headings (h1,h2,h3). When h1 was too big for the chapter heading, I just used h2. Is this good practice? Or should I always set a font-size for the headings in my css? Is what is written here (http://www.w3.org/TR/CSS2/sample.html) the default size for headings? So if you dont set them in CSS, this is the size they get? h1 { font-size: 2em; margin: .67em 0 } h2 { font-size: 1.5em; margin: .75em 0 } h3 { font-size: 1.17em; margin: .83em 0 } JLius |
![]() |
![]() |
![]() |
#2 | ||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
That said, there's a bit of leeway in what <h1> means. Is it for the book title? For parts, even if there are no parts?... Personally, I often use <h1> for chapters, and if there are parts, I use <h1 class="part"> or something like that. Quote:
|
||
![]() |
![]() |
![]() |
#3 |
Village idiot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
|
I use h1 for chapter titles, sometims h2 when h1 is too big, and h2 or h3 for subtitles.
So you're saying I should always set a font-size in css for h1,h2,h3? |
![]() |
![]() |
![]() |
#4 | ||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Code:
<h1>Chapter One: The Beginning <span class="subtitle">How everything started</span></h1> Quote:
|
||
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,003
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:
And the 500lb e-book Gorillas follow those ![]() If you want a value. SET IT (and hop the Gorillas allow you to play that much) ![]() Use headings for Hierarchy , not size |
|
![]() |
![]() |
![]() |
#6 |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
|
![]() |
![]() |
![]() |
#7 |
Village idiot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
|
Allright, thanks all (especially Jellby)!
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
A bit late, but ok. If you have to make a choice between semantics or layout, always go for semantics. If labelled correctly, you can easily apply the layout you want. The other way round is not possible...
I personally use H1 for Book title, H2 for chapters and H3 for sections/sub-chapters/etc. Sometimes in an anthology I use H2 for the writer and H3 for the story title. If a story has multiple chapters, it would be H4. Since I use this consistently, for me it is always very clear what it what. |
![]() |
![]() |
![]() |
#9 |
Village idiot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
|
For book title(page) I gave up tinkering with code, the result was never ideal (dependent on font-size etc). I chose to use a jpg as titlepage instead, that way title, author, publisher... are always positioned the same way.
|
![]() |
![]() |
![]() |
#10 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
This is one case where descriptive alt text would be most useful.
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Oh, I agree. I usually use an optimized png for the titlepage since it is usually black and white anyway. Much smaller.
|
![]() |
![]() |
![]() |
#12 | |
Village idiot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
|
Quote:
Situation before: Code:
h1 { text-align: center; padding-bottom: 20px; padding-top: 10px; } h2 { text-align: center; padding-bottom: 70px; padding-top: 10px; } h3 { text-align: center; padding-bottom: 1.5em; padding-top: 1.5em; font-weight: normal; font-style: normal; font-size: 1em; } So now I try this: Code:
.subtitle { padding-bottom: 70px; padding-top: 30px; } But the result doesn't look anything like the initial h1 h2, which are separated by sufficient padding. The extension to the title chapter number appears on the same line. I don't want to add a </br>, that doesn't feel right. But even when I do, the padding-top doesn't work, even when I set it to 100px. What am I doing wrong? The h3 is for real subtitles, so I think I can leave that the way it is? |
|
![]() |
![]() |
![]() |
#13 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
How about:
Code:
.subtitle { display: block} <span> is by default an inline element, <div> is by default a block element, both with no other semantic content. I don't remember the details, but it may be that inline elements do not have any padding, or at least vertical padding. |
![]() |
![]() |
![]() |
#14 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,730
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
Tags |
css, epub, font-size, headings |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem changing font size using font size key | Waylander | Conversion | 0 | 10-02-2013 03:30 PM |
Determine font and font size on incoming epub? | peaceridge | Calibre | 4 | 01-30-2012 03:35 PM |
PRS-300 Med font size too big, but small font size too small | eli2k | Sony Reader | 4 | 05-28-2010 09:47 AM |
Different font for headings | bremler | ePub | 4 | 03-11-2010 06:03 AM |