Quote:
Originally Posted by pedrovic
Hi, group, how are you? I am a graphic designer who is migrating to the "literary" mobile world. I have read a lot about html and css for epub and mobi, but I have a question that I still can not solve: When a chapter page has two elements: chapter number and, below, the chapter title, which hierarchy of headings ? I could start with a <h3> for the chapter number and then insert a <h1> in the title? the goal is to leave this larger than the first.Something like that:
Chapter 1
The life of Brian
This is my first post, and I could not find this question here, so if it already exists, I apologize for repeating a post.
Thank you all!
|
I would enclose both elements in the same <h?> tag with a <br /> to break the line and a css class to increase the size of the title.
As a quick and dirty example (the first line is from the text, the two classes are in the stylesheet:
Code:
<h3 class="chapternum">Chapter 1<br/><span class="bigc15">The Ending of the Beginning</span></h3>
.chapternum {
font-size: 1.5em;
margin-top: 2em;
margin-bottom: 1.5em;
margin-right: 0;
margin-left: 0;
page-break-after: avoid;
text-align: center;
font-weight: bold;
}
.bigc15 {
font-size: 1.5em;
}
Generally, I prefer to do as much as possible with the stylesheet and avoid in-line styles like the plague. In the code above, the first part of the chapter heading is displayed with 1.5 time the default font size while the subheader is displayed at 2.25x the default font size (1.5x1.5=2.25).
Also note that this is for epub. Mobi should work much the same but oddities will occur.