05-18-2010, 07:21 PM | #1 |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Sigil and CSS files
When a raw PG file is loaded into Sigil the CSS file comes with it. Sigil apparently converts some to sgc-#. Initially is no file in the Styles Section.
The Sigil <head> contains the following: Code:
<link rel="stylesheet" type="text/css" href="../Styles/" /> Now my queations: How do I make the external CSS file come into effect? How are conflicts between definitions in the PG Style Sheet and the external Style Sheet to be resolved? e.g. body, p, and h2 definition. Perhaps someone knowledgable could post a short tutorial until the final manual comes out. |
05-19-2010, 11:12 AM | #2 | |
Lord of the Universe
Posts: 670
Karma: 737849
Join Date: Jan 2008
Location: Maturin , Venezuela
Device: Sony Reader PRS-505 / PSP
|
Quote:
1- You should write the name of your css file in the stylesheet link for example: Code:
<link rel="stylesheet" type="text/css" href="../Styles/thenameofyourcssfile.css" /> 2 - I honestly don´t know but you should never have any conflicting css, if there are duplicate definitions for body p, h2 or whatever you should erase the one you don´t want. If you want different looks for different instances of the same element that´s what classes are for. |
|
Advert | |
|
05-19-2010, 06:23 PM | #3 |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Here is what I have tried:
1: Load PG html file into Sigil. 2: As soon as the file is loaded, Open Styles and add the following css file Code:
/* make all hyperlinks black */ a { color: #000000; } /* leave room for page numbers etc in ade */ body{ margin-left: 15px; margin-right: 15px; } /* just a little spacing between paragraphs with nice indent */ p { margin: 0; padding-bottom: 5px; text-indent: 1.5px; } /* make it look more book-like */ h1, h2, h3, h4, h5, h6 { margin: 0; padding-bottom: 5px; text-align: center; } /* remove paragraph indent */ .noindent{ margin: 0; padding-bottom: 5px; text-indent: 0; } Code:
<link rel="stylesheet" type="text/css" href="../Styles/"main.css" /> 4. Remove style sheet entries from Sigil. 5. Go back to textview. NO EFFECT 6: Go back to codeview All sgf-# have disappeared from the code. The style sheet entry reverts to Code:
<link rel="stylesheet" type="text/css" href="../Styles/" /> |
05-19-2010, 06:43 PM | #4 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
|
05-19-2010, 11:21 PM | #5 |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
This procedure works!!!
1: Load the HTML file into an external editor.
2: Extract the style sheet from the HTML and save as main.css in the same folder as the HTML file. 3: Place the following code into the HTML file: Code:
<link rel="stylesheet" type="text/css" href="main.css" /> 5: Modify main.css as desired and re-test. 6: Load the HTML file to Sigil. 7: Open codeview and go to the top and find the following code; Code:
<link rel="stylesheet" type="text/css" href=../Styles/"main.css" /> From this point on, everything is tea and cookies, This may violate the spirit of Sigil but until someone comes up with a better procedure, I'm happy. This solves my problem with PG files. BTW, ADE has no problems with it. |
Advert | |
|
05-20-2010, 06:08 AM | #6 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
crutledge, the path to the CSS file is still wrong. You're current procedure relies on Tidy to fix it for you.
First you had this: Code:
href="../Styles/"main.css" Code:
href=../Styles/"main.css" Code:
href="../Styles/main.css" |
05-20-2010, 09:02 AM | #7 |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
My error in the posting. Sigil has it correct.
Many thanks |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating omnibus files with Sigil | crutledge | Sigil | 6 | 09-23-2010 06:52 PM |
Multiple CSS Files | jjm6383 | Sigil | 2 | 06-28-2010 05:44 PM |
Cover problems with Sigil files (again) | crutledge | Calibre | 3 | 06-16-2010 12:06 PM |
Sigil styles and CSS | View[+]Finder | Sigil | 4 | 05-27-2010 05:39 PM |
Help! Newbie having problems converting HTML/CSS files | jackie_w | Calibre | 6 | 09-14-2009 04:53 PM |