Thread: Stacked boxes
View Single Post
Old 11-12-2021, 02:04 AM   #1
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,622
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Stacked boxes

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
Attached Thumbnails
Click image for larger version

Name:	chapterhead1.jpg
Views:	492
Size:	19.9 KB
ID:	190152  
Karellen is offline   Reply With Quote