View Full Version : Multiple CSS


Gray Eminence
01-13-2011, 07:43 AM
Hello,

Is there a specific way to use muliple CSS's in ePub ?
I do have two CSS, standard names, section ponting to the correct CSS

But in ADE and other reader, it's like the CSS's doesn't exist anymore :smack:

Thanks
GE

Jellby
01-13-2011, 07:51 AM
You can use as many CSS files as you want, but you have to reference them in the XHTML files. Look for something like:

<head>
<title>Part IV &mdash; Chapter XII</title>
<link href="css/style.css" type="text/css" rel="stylesheet" />
</head>

You can add more <link href="..." /> lines as needed.

Gray Eminence
01-13-2011, 08:02 AM
I do have the following, which work in Sigil :

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../Styles/style001.css" rel="stylesheet" type="text/css" />

<title></title>
</head>


and


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../Styles/style0001.css" rel="stylesheet" type="text/css" />

<title></title>
</head>


And still, ADE seems to ignore them :chinscratch:

Jellby
01-13-2011, 08:34 AM
There might be a syntax error, misspelling or unrecognized keyword in the CSS file, ADE tends to ignore everything as soon as it finds something it doesn't like.

Gray Eminence
01-13-2011, 09:19 AM
Definitivelly not a syntax issue "in the css", it look smore like a pointing issue.
I did copy all second CSS code in the first one and it works.

The style001.css works
If I rename it to style0001.css (all sections pointing to it), it's not working anymore. Like ADE only abble to accept the style001 and nothing else.

What sounds illogic based on your comments, it should work :chinscratch:


PS : i renamed the 0001 in 001, and surprise, it doesn't work back, looks like Sigil is messing something to the pointing codes

Jellby
01-13-2011, 09:26 AM
Do you also change the name in the OPF file?

Gray Eminence
01-13-2011, 09:43 AM
Do you also change the name in the OPF file?

Nope, not yet that far in my learning.

I would had expected Sigil to do it .....

I will leanr somthing new then

Gray Eminence
01-13-2011, 10:52 AM
Seems it's correct in the opf

<item id="Style0001.css" href="Styles/Style0001.css" media-type="text/css"/>
<item id="style001.css" href="Styles/style001.css" media-type="text/css"/>

:thinking2

Gray Eminence
01-13-2011, 11:10 AM
case-sensitive :rifle:

When sigil create the original CSS, it's called style001
When it creates a new one, it's called Style0001 (note the S instead of s)

Of course, when I edited my section link , I just added a 0, and it works fine in Sigil. But ADE seems to be more case-sensitive than Sigil.


There is something weird in Sigil to maybe change in a future release (the first with s and next ones with S is strange to me)

Thank you Jellby for you appreciated help and time :thanks:

Cheers,
GE