Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-28-2014, 03:11 PM   #1
SeaCanary
Enthusiast
SeaCanary began at the beginning.
 
SeaCanary's Avatar
 
Posts: 34
Karma: 10
Join Date: Jan 2014
Device: Nook
Where To Put <style type="text/css"> Code

I built an epub file that has many html files in it. Every html file has the following code.
Code:
<head>
  <title>Only Remembered</title>
  <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/>
  <link href="../Styles/page_styles.css" rel="stylesheet" type="text/css"/>
  
<style type="text/css">
  h2.sgc-1 {text-align: center;}
  h3.sgc-2 {text-align: center;}
  body.sgc-3 {word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;}
</style>
</head>
Can I put the code in the style section in just one place in the epub document or does it have to be in each html file.?
SeaCanary is offline   Reply With Quote
Old 01-28-2014, 03:21 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by SeaCanary View Post
I built an epub file that has many html files in it. Every html file has the following code.
Code:
<head>
  <title>Only Remembered</title>
  <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/>
  <link href="../Styles/page_styles.css" rel="stylesheet" type="text/css"/>
  
<style type="text/css">
  h2.sgc-1 {text-align: center;}
  h3.sgc-2 {text-align: center;}
  body.sgc-3 {word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;}
</style>
</head>
Can I put the code in the style section in just one place in the epub document or does it have to be in each html file.?
Put it where it belongs: The stylesheet, then link the stylesheet to all the needed files.

Note: SGC Page styling as you show is NOT transferable between pages.

SGS# are assigned in the order used ON THAT FILE
so on one page SGC-1 might be used by:
h3.SGC-1 {text-align:center; font-style: italic; }
and another page
h2.SGC-1 {text-align:center; font-weight: bold; }


Create your own style selectors and replace the each class="with newname"
theducks is offline   Reply With Quote
Advert
Old 01-28-2014, 03:44 PM   #3
SeaCanary
Enthusiast
SeaCanary began at the beginning.
 
SeaCanary's Avatar
 
Posts: 34
Karma: 10
Join Date: Jan 2014
Device: Nook
Quote:
Note: SGC Page styling as you show is NOT transferable between pages.
So what you're saying is I have done it correctly?

I have two css files in the epub file with the rest of my formatting.
  1. page_styles.css
    Code:
    @page {
        margin-bottom: 5pt;
        margin-top: 5pt
        }
  2. stylesheet.css
    Code:
    .calibre {
        display: block;
        font-size: 1em;
        margin-bottom: 0;
        margin-left: 5pt;
        margin-right: 5pt;
        margin-top: 0;
        padding-left: 0;
        padding-right: 0
        }
    .versebody {
        display: block;
        margin-bottom: 0em;
        margin-left: 1em;
        text-indent:-1em;
        margin-right: 0;
        margin-top: 0em
        }
    ...
SeaCanary is offline   Reply With Quote
Old 01-28-2014, 04:04 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
As long as they are linked to the pages:
In the file browser: Select all the files that make up the main body (content, usually not the boilerplate files:titlepage,coverpage)
rightclick: Link stylesheet: tick BOTH CSS you list as any existing usage not ticked will be deleted.

There is no need of the infile CSS if you cover those cases in the main CSS

h2, h3 {text-align: center; }
centers all H2 and H3.. Anyplace in the book
theducks is offline   Reply With Quote
Old 01-28-2014, 08:33 PM   #5
SeaCanary
Enthusiast
SeaCanary began at the beginning.
 
SeaCanary's Avatar
 
Posts: 34
Karma: 10
Join Date: Jan 2014
Device: Nook
Thank you.
SeaCanary is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Suggestion] Sigil validator should check missing type="text/css" attribute quiris Sigil 13 01-21-2018 02:00 PM
CSS to "wrap" text between two .xhtml files? december Sigil 28 12-06-2013 03:29 PM
Sigil eBook Editor, Would Like To Put "Remarks" in Code View Not To Appear in... Al Adams Sigil 5 09-04-2013 09:35 AM
Using a CSS "style reset" santosha Kindle Formats 11 06-29-2013 12:01 AM
ePub to Mobi: can't get the reference type="text" to work LaoTseu Conversion 7 09-14-2011 12:06 AM


All times are GMT -4. The time now is 05:19 AM.


MobileRead.com is a privately owned, operated and funded community.