Thread: Stacked boxes
View Single Post
Old 11-12-2021, 08:55 AM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,825
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Karellen View Post
The book I am currently reading has a decorative chapter heading as shown in the image. But the book creator simply scanned the chapter heading from the paper book and inserted the image into the book. There are 132 images. Also, when using a dark or sepia theme in the ebook, the white background in the jpg file is visible.

I created a CSS/HTML version of the same heading. But I think it is a bit messy and complex. Is there a neater way to do this?

My CSS code...
Spoiler:
PHP Code:
.box1 {
  
marginauto;
  
width130px;
  
height100px;
  
border1px solid gray;
  
background-colorgray;
  
box-sizingborder-box;
  
text-aligncenter;
}
.
box2 {
  
marginauto;
  
width130px;
  
height10px;
  
border1px solid gray;
  
background-colorgray;
  
box-sizingborder-box;
  
text-aligncenter;
}
.
box3 {
  
marginauto;
  
width420px;
  
height20px;
  
border1px solid black;
  
background-colorblack;
  
box-sizingborder-box;
  
text-aligncenter;
}
.
chapterno {
  
font-size3.0em;
  
font-familysans-serif;
  
colorwhite;
  
line-height0;
  
margin-bottom25px;
  
text-aligncenter;
}
.
chapterword {
  
font-weightbold;
  
font-size.8em;
  
font-familysans-serif;
  
colorwhite;
  
line-height0;
  
text-transformuppercase;
  
text-aligncenter;



My HTML code...
Spoiler:
PHP Code:
  <class="box2"></p>
  <
class="box3"><span class="chapterword">C&#8195;H A P T E R</span></p>
  
<div class="box1">  
  <
class="chapterno">99</p>
  </
div
There are easier ways to do what you want But before giving you a "solution", I need to know if you are working on epub2 or epub3?
RbnJrg is offline   Reply With Quote