Can you modify the default CSS Stylesheet? How to?

The failure :
ERROR(CSS-020): ./books/Bo/databases/eBookIt/temp_uploads/1593550418.epub/OPS/css/stylesheet.css(17,86): CSS font selector declaration uses unexpected font-size value ‘1.08rem’.

From CSS style in the project format that I have saved.
Not sure how it got there or how to remove it.

Please advise

See Below:
.heading-2 { margin: 0.67rem 0rem 0.67rem 0rem; text-indent: 0rem; text-align: center; line-height: 1em; font-size: 1.08rem; font-weight: normal; }
.page-title { margin: 0rem 0rem 1rem 0rem; text-indent: 0rem; text-align: center; line-height: 1em; font-size: 1.17rem; font-weight: normal; }
.section-number { margin: 0rem 0rem 1.33rem 0rem; text-indent: 0rem; text-align: center; line-height: 1em; font-size: 1.33rem; font-weight: normal; }
.sub-heading { margin: 0.67rem 0rem 0.67rem 0rem; text-indent: 0rem; text-align: center; line-height: 1em; font-size: 1.08rem; font-weight: normal; }



Thank you in advance.


What is the “default CSS stylesheet” you are referring to in this case? There are a several places where CSS comes into export and compile. Do you mean for example, how to change the CSS for Pandoc generated ebook files? Probably not, as most people do not even have Pandoc installed, but that’s one place.

Which ePub validation tool are you using? The only time I’ve seen an error like this was in older version of Sigil, which lacked ePub3 support and thus CSS3 support. The root-em unit, ‘rem’, is not recognised by the older validator Sigil used. The modern version handles ePub3 and its component formats just fine, as does EPUBCheck v4.2.4.

In coming across another of your posts, it seems you are compiling, and using the ePub option for export?

If so, you need to edit the compile Format and visit the CSS pane to make your changes. If by “Default CSS Stylesheet” you are referring to the contents of the default column itself, there is no way to change that directly (most of this comes from settings you make elsewhere in the GUI), but given how CSS works, the custom column, which will be appended to the bottom of the stylesheet.css file, is going to take precedence over anything in there. And of course you can set it to only use custom CSS, and in that case you have full control (i.e. many of the GUI settings will no longer do anything) and will need a much more comprehensive stylesheet provided.

You can read more about the CSS pane in the user manual PDF, §24.7, CSS, pg. 647.

THANK YOU for replying to my post…

I actually thought I had finished the formatting, which had passed the Website testing for EPUB format months ago. When I went to put the book up again on Smashwords it failed the formatting on the Font size of 1.o8rem in heading 2.

I don’t believe I have formatted anything in the text using heading 2.

As you can see it is in the default CSS layout, and I can’t figure out how to change it or where it is coming from.

ePub files are very easy to open up and examine directly with the right tool. I would recommend Sigil, which I referred to in the other thread. You can run book-wide searches for stuff like “

” to verify whether or not your guess is correct.

To reiterate what was said before, the Default CSS Stylesheet is generated from the settings you change with checkboxes and such—the GUI. Your project, its compile settings, and the state of your text itself, has nothing to do with what gets put in there.

That said, if you’re using Scrivener’s built in Ebook preset as a starting point, it has some rather odd uses of header levels that one should be aware of. For example the stock Table of Contents layout uses H2 for its main section heading, instead of H1.

The user manual section that I referred to you discusses this, in the middle of page 648. I explains where it comes from, and how to change the setup so you can modify the CSS.

Thanks, I will look into that section and dbl check sigil

HI Again, thanks for the info…
I went to the Manual and read the two pages.
Made a change to the font size from 12 down to 11 and up to 14.
It was set to 13 for the Index.

I tried to validate again.
And now it fails with the same failure but the font failure is .92 rem now instead of 1.08rem.
And still fails.
ERROR CSS-020 /OPS/css/stylesheet.css
(line 17, col 86) CSS font selector declaration uses unexpected font-size value ‘0.93rem’.

I am completely lost… It does not seem to produce a standard size font which is causing the failure.
I have no clue what size they want for it pass the validation, since there seems to be no standards published.
Nor how to produce a standard size since the app only lets you choose between Standard type font sizes like 11, 12, 13 pt.

I made note of what I suspect the error means in your other thread, which I have merged into this one.

I think it might be best to contact their support about it. You’re the first person I believe who has reported this error, and I’m sure many thousands of people have submitted ePubs with this unit of measurement to Smashwords. Unless they have only just recently decided to downgrade to a decade old format, there may be some upload settings or something that they can help you sort out.

Otherwise, I can’t really say why this CSS is giving you problems, because technically it is a valid ePub file. Here is ePubCheck’s report on a test epub that contains only your pasted .css:

[code]Validating using EPUB version 3.2 rules.
No errors or warnings detected.
Messages: 0 fatals / 0 errors / 0 warnings / 0 infos

EPUBCheck completed[/code]