![]() |
Formatting sgc-toc.css font-size
2 Attachment(s)
I've been following another interesting thread here about TOC's and sgc-toc.css and saving it in preferences
I've got most of it the way I want, but for some reason known only to CSS, the level-1 font-size is applied to everything I think I'm getting tangled up with all the nested <div> tags that Sigil's Make HTML TOC creates Code:
div.sgc-toc-title {Any ideas? Thanks Paul |
Why worry about the nested level of div simply use .svg-toc-level-x
Dale |
Quote:
I did get something to work, but I don't know why the it is working the way you see. Code:
div.sgc-toc-level-2 { |
@theducks
You were able to reproduce it also, correct? Percent does indeed do the trick, but it's still a little to the left of weird :blink: @DaleDe Sorry, not exactly sure of what you're saying. Could you expand a little more please Thanks Paul |
Quote:
The TOC uses nested (level Divs) Level 2 is inside a Level 1. I tried a -1em :o NOT ALLOWED Keeping the nests straight IN THE CODE seemed beyond me (and would not survive a regen of the TOC). This way survives as Sigil will not replace an existing stylesheet DaleDe's method is not the default Sigil (Generate HTML TOC) way |
Quote:
For example .bold could be used anywhere include a paragraph, div, or a heading while h2.bold could only be used in a h2 statement. Using a . as the leading character generalizes the class which can still be overridden with a more specific class designation. This is what Cascading Style Sheet is all about. Dale |
Quote:
Code:
.svgSigil classes are .sgc I dropped the (css)div in some my tests. It has to be some nesting quirk |
@DaleDe --
I basically understand the CSS concepts (OK, sort of) When I create a Sigil HTML TOC, the Sigil generated CSS: Code:
div.sgc-toc-title {The TOC HTML Sigil generates: Code:
<body>Since Sigil will completely regenerate the TOC file, editing it seems like a waste of time, so I was trying to work with the sgc-toc.css file and save it in Preferences. In level-1 I made font-size: 2em and I thought that if I left font-size: 1em in level-2, it would look nicer Code:
div.sgc-toc-level-1 {What was happening was that it seemed like the level-2 font-size was not being honored, and what ever was in level-1 font size was used throughout. I suspect that within a container, you can only adjust font relative to the container's font-size (?????). That seems kind of familiar, but I could be very wrong. But theduck's percent seems to work nicely Paul |
Sorry Paul, svg was a typo, it should have been sgc but as a class name svg could be used and would not be talking about a graphic image anyway. I understood the original problem and removing the div's from the from of the class names will resolve it.
Dale |
2 Attachment(s)
Quote:
But even without the div. 's in the CSS, it still doesn't seem to work (assuming I'm understanding it correctly). I made the level-1 font 4em just to see, and level-2 font 1em Code:
/* Sigil TOC CSS template, loaded when Tools, TOC, Create HTML TOC */Paul |
I see the problem and it is not unique to Sigil, ADE and Azardi have the same problem. It would seem that a div inside another div inherits the outside div information and the inside div either cannot change it or is changing it relative to the outside div, in other words the outside div may be defining the size of an em. It is an interesting problem. There, of course, is no real need to nest the on page toc in div statements in the first place.
I wasn't able to find anything in the specs that define what should happen with div's are nested, even though they are permitted according to the specs. It is a problem of scope and CSS really doesn't have anything to do with it except incidently. Dale |
Dale -- thanks for the insight and info
theducks' percentage based font-size works, and seems to be in accord with what you said about inheriting properties. Possibly the Sigil team will simplify the generated HTML TOC and get rid of all those nested <div>s I had thought about manually doing it, but Sigil will just generate a new one with nested <div>s again But for now I have a sgc-toc.css template that will be a good starting point (even if it is a little convoluted) :-) Thanks to you both for your help Paul |
Try
Code:
div.sgc-toc-level-1 { |
1 Attachment(s)
@kamanza --
That also works, but since the TOC generated by Sigil has all those nested <div>'s, it still seems to define the 'em' for toc-2 relative to toc-1. I.e. toc-1 is 2em, and toc-2 is 1em/2em = 1/2 of toc-1. To me it seems like a percentage of the container Going the other way ... Code:
div.sgc-toc-level-1 {Bottom line, it's those darn nested <div>'s that cause the issue, but now that I understand what's happening, either the percent or the em based font size can be made to work Paul |
| All times are GMT -4. The time now is 06:57 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.