Multi-level lists not respected in CHM output

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
Wendy F
Propeller Head
Posts: 29
Joined: Thu Sep 10, 2015 5:24 am

Multi-level lists not respected in CHM output

Post by Wendy F »

We use complex selectors in our CSS to style our multi-level lists. Everything looks great in the HTML5 output, but for some reason the CHM does not respect the indents on second-level items (ol or ul). We had a similar problem with our print output, but that was solved by creating a different left margin for the print medium. The HTML5 and CHM targets use the default medium. And the CHM is using the Browser Default Size.

FWTW This is what we have in the CSS, starting with styles for the default medium.

Code: Select all

ul ul,
ol ul
{
	margin-left: -20px;
}

ol ol,
ul ol
{
	list-style-type: lower-alpha;
	margin-left: -20px;
}

@media print
ol ol
	{
		margin-left: 1.5em;
	}

	ol ul
	{
		margin-left: 1.5em;
	}

	ul ol
	{
		margin-left: 1.5em;
	}

	ul ul
	{
		margin-left: 1.5em;
	}
But my real question is,"Why would the CHM output be so different than the HTML5?"

Thanks!
NorthEast
Master Propellus Maximus
Posts: 6347
Joined: Mon Mar 05, 2007 8:33 am

Re: Multi-level lists not respected in CHM output

Post by NorthEast »

If that's the actual CSS, then you're missing the opening and closing brackets from the print media section.

@media print
{
ol ol
{
margin-left: 1.5em;
}

...

}
Wendy F
Propeller Head
Posts: 29
Joined: Thu Sep 10, 2015 5:24 am

Re: Multi-level lists not respected in CHM output

Post by Wendy F »

not an actual CSS...just lines that I copied.
GregStenhouse
Sr. Propeller Head
Posts: 330
Joined: Tue May 13, 2008 3:27 pm
Location: Christchurch, New Zealand

Re: Multi-level lists not respected in CHM output

Post by GregStenhouse »

CHM help uses an older version of IE to render it's output (I think IE7). My guess is the older version doesn't support complex selectors in that way, or perhaps modern browsers add additional indents in their inbuilt stylesheet that CHM help doesn't.

Try using IE's F12 Developer Tools to set the Emulation/Document Mode to IE7 and see if you can replicate the problem in HTML files generated from your web help/css. That may help you tweak your CSS and find a solution that works for both HTML5 and CHM.
NorthEast
Master Propellus Maximus
Posts: 6347
Joined: Mon Mar 05, 2007 8:33 am

Re: Multi-level lists not respected in CHM output

Post by NorthEast »

Wendy F wrote:The HTML5 and CHM targets use the default medium.
If they both use the (default) medium, then you print medium is irrelevant.

Also, I just noticed your default margin is -20px.

I'm not sure why you have a negative margin, but it presumably explains why your list looks wrong - I'd imagine that the first level of the list is probably disappearing off the left of the window.

I think you need to sort out your list margin and padding, without using negative values.
Post Reply