Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-04-2011, 03:48 PM   #1
triplemaya
Member
triplemaya began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2011
Device: Kindle
Global css

This feels like a stupid question, but I have done a lot of browsing and I can't work it out. I am using the css in the individual files no problem. I can find no reference anywhere to a defintion of the <h1> etc defintions. They seem to be simply the defaults. So I am assuming that they will vary on different systems.

I would expect to be able to set the global defaults, but I can't find where to do this. In the Style folder sybol there are the choices Add existing items or Add new items. But when I use these to add a new css file, it seems to have no effect on the headings.
triplemaya is offline   Reply With Quote
Old 12-04-2011, 04:15 PM   #2
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
You need to reference the CSS file in the xhtml document, i.e
Code:
<link href="../Styles/defaults.css" rel="stylesheet" type="text/css" />
There is no global CSS configuration, you will need to add it to each included document, this can be done by regex quite easily.
Serpentine is offline   Reply With Quote
Advert
Old 12-04-2011, 04:36 PM   #3
triplemaya
Member
triplemaya began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2011
Device: Kindle
Thanks Serpentine. But there are 50 documents in my ebook. And if I understand correctly, I am adding in a new piece of code to each one, not just doing pattern recognition and replacement. I don't understand how one could use regex to access a batch of documents. Please could someone give me a how to on the way to do this please.
triplemaya is offline   Reply With Quote
Old 12-04-2011, 04:46 PM   #4
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
It's not the most elegant nor even real regex, but something as simple as :
Code:
find : </head>
replace : <link href="../Styles/defaults.css" rel="stylesheet" type="text/css" />\n</head>\n
Change the filename as needed first.
Serpentine is offline   Reply With Quote
Old 12-04-2011, 04:48 PM   #5
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
@triplemaya:

I'm assuming that each document is html and/or xhtml, right? So, search for:

Code:
<head>
and replace it with

...ooops, serpentine just beat me to it. ;-)

Hitch
Hitch is offline   Reply With Quote
Advert
Old 12-04-2011, 05:16 PM   #6
triplemaya
Member
triplemaya began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2011
Device: Kindle
Thanks, but how do I apply that to 50 files?
triplemaya is offline   Reply With Quote
Old 12-04-2011, 05:26 PM   #7
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Change the 'Look at' option to 'All HTML Files'
Serpentine is offline   Reply With Quote
Old 12-04-2011, 05:28 PM   #8
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: 31,039
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:
Originally Posted by triplemaya View Post
Thanks, but how do I apply that to 50 files?
All HTML files option on Search and replace.
I prefer to us the Down direction ONLY, so I start with the first file in the Book Browser , switch to CV
with those 2 terms in the correct boxes, Find first (should work to the correct place), Replace All.

File Open (same file), DISCARD if happens
otherwise, Save
theducks is offline   Reply With Quote
Old 12-04-2011, 05:33 PM   #9
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
n.b.: You have to have the book (file) open in CODE VIEW, not BOOK VIEW. I think we all forgot to mention that.

There are great tutorials on CSS and xhtml at W3schools.com.

Hitch
Hitch is offline   Reply With Quote
Old 12-04-2011, 07:17 PM   #10
triplemaya
Member
triplemaya began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2011
Device: Kindle
Thanks everyone. Real simple once I got it.

Cheers
triplemaya is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Override ePub CSS with userStyle.css? barium Sony Reader Dev Corner 11 07-16-2011 03:25 PM
epub CSS versus "Regular" CSS konrad ePub 4 02-18-2011 09:29 AM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM
How to maintain a global CSS stylesheet amoroso Sigil 7 07-18-2010 08:37 PM
How is it possible to tell difference b/w Global and non Global? steffi Amazon Kindle 3 01-24-2010 11:07 AM


All times are GMT -4. The time now is 02:34 AM.


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