Add CSS to specific topics

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Add CSS to specific topics

Unread postby John Johann » Fri Jul 06, 2018 7:23 am

I'm trying to insert SVG images formatted using CSS in a project for CHM export.
I'd like to link the CSS only to those topics which also have the respective SVG.
Where do I need to put it?
John Johann
 
Posts: 67
Joined: Mon Aug 21, 2017 7:35 pm

Re: Add CSS to specific topics

Unread postby Simon_Dismore » Fri Jul 06, 2018 9:23 am

John Johann wrote:I'm trying to insert SVG images formatted using CSS in a project for CHM export. I'd like to link the CSS only to those topics which also have the respective SVG. Where do I need to put it?

If you're talking about using an external stylesheet with SVG, the most natural place to reference it would in the SVG document itself. That way it will only be included where there's an SVG image.

But I wonder why you care about this? CHM's are loaded from the local file system, so there's no bandwidth issue, and stylesheets will be cached by the browser in most cases.

By the way, if you are looking to have style inline SVG symbols in HTML pages, Sara Soueidan's article Styling SVG <use> Content with CSS might be helpful.
Simon_Dismore
 
Posts: 33
Joined: Thu Jul 13, 2017 2:57 pm

Re: Add CSS to specific topics

Unread postby John Johann » Fri Jul 06, 2018 10:13 am

Thanks.
Experimented further. I think the problem was more with how I was inserting the svg image file itself.

I put the svg.css in the Baggage.

When I insert the svg via Insert > image, the styles are not applied in the output.

When I insert the image via a div in an html code object, I get a missing object error.

When I insert the image via a div in an html code object, and include an img src tag as a fallback, it seems to work.
John Johann
 
Posts: 67
Joined: Mon Aug 21, 2017 7:35 pm


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron