• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

rh8: snippets: CSS styling - how is it done?

Engaged ,
Jan 15, 2011 Jan 15, 2011

Copy link to clipboard

Copied

I've been working my way through a project with a lot of help here -- thanks all!

Now... I have a number of topics, and a lot of snippets that are used in them.

If I am in a topic, I can see all of my CSS character and paragraph styles, including a character style that I use for menu selections.

If I am in a snippet, I don't have those styles. I just get what I assume are the default styles.

I read in a page somewhere on the adobe site that the snippets will have the CSS applied to them from the topics in which they appear. That makes sense.

But... how then, does one tag the content in a snippet?

Snippet example:

Select Foo > Bar.

That's what I would *like* the snippet to look like when it appears in my topics. (All of my topics have a character style 'Selection' that is Bold/Red (for the sake of this question, at least :-)).

However, I don't have that character style available in the snippet.

What do I do?

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 16, 2011 Jan 16, 2011

You have to apply inline styles. If ever you need to change that, it's a bit like CSS in that you only have to change it once, in the snippet.

You can apply classes in the snippet.

Tables are more tricky and the easiest solution is to create what you want in a topic and paste it into a snippet. It will look wrong in the snippet but OK on preview and generation of a topic.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Votes

Translate

Translate
Community Expert ,
Jan 16, 2011 Jan 16, 2011

Copy link to clipboard

Copied

You have to apply inline styles. If ever you need to change that, it's a bit like CSS in that you only have to change it once, in the snippet.

You can apply classes in the snippet.

Tables are more tricky and the easiest solution is to create what you want in a topic and paste it into a snippet. It will look wrong in the snippet but OK on preview and generation of a topic.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 16, 2011 Jan 16, 2011

Copy link to clipboard

Copied

Thanks Peter, I thought it might be something like that.

And thanks for the point about tables -- definitely worth knowing 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 17, 2011 Jan 17, 2011

Copy link to clipboard

Copied

Hi,

In addition to Peter's answer, you can manually add a style sheet to a snippet. The style sheet is not used in the output, but you can select styles in the regular way.

A snippet is just a .htm file with a different extension. To add a style sheet, go to HTML mode and add <link rel="stylesheet" type="text/css"  href="mycss.css" />

The snippet is in the root of your project, so be sure to use the correct path. Save and go to WYSIWYG mode. The snippet is now correctly formatted and you can use the styles from your css.

Greet,

Willam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2013 Aug 09, 2013

Copy link to clipboard

Copied

I have tried the suggestions above in rh9, including adding the stylesheet to the snippet. My great frustration involves the style for representing code, which includes a 1px border. When this style is applied in a normal topic (no snippet) the html tag is simply a p class in the generated html file:

<p class="code">

For some bizarre reason, when there is a code block in a snippet, inserted into a page & published as WebHelp, there is a mysterious addition to the html tag making the border 4px wide (see below, copied from the generated html)

<p class="code" style="

font-size:10pt;

font-family:'Courier New' , Courier, monospace;

margin-top:0pt;

margin-bottom:6pt;

color:#000000;

border:1pt solid #c0c0c0;

padding:8px 5px;

border-width:4px;">

I went so far as to actually open & search the entire text of the CSS to see if there was some random style being applied inadvertently, and there is NO style which includes a "border-width:4px" formatting component. I am stumped! Any suggestions?

Suzie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 24, 2013 Aug 24, 2013

Copy link to clipboard

Copied

I just set up a Rh9 test adding your style to the CSS and then applied it to the content of a snippet. In both the source and output topic all I am seeing is <p class="code">.

Try again in a new project using the default.css to see if it works OK then. If it does, then it has to be something else in your snippet or css causing the style stuff to be added. Are you sure there is no inline styling kicking in?


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 26, 2013 Aug 26, 2013

Copy link to clipboard

Copied

Peter,

Thank you for taking the time to test this. I will check again, but I could not see any inline styling when I look at the html if I recall correctly.

Suzie

SuzieMedders

Technical Writer

<http://omnibond.com/> OmnibondLogo

Omnibond Systems LLC

Post Office Box 793

Pendleton, SC 29670

<mailto:suzie@omnibond.com%0d> suzie@omnibond.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 26, 2013 Aug 26, 2013

Copy link to clipboard

Copied

LATEST

Peter,

Thank you for taking the time to test this. I'm encouraged that you got a different result. When I checked the html I didn't see any inline style applications. I will go back and look at it again. I decided to just leave it the way it was because it was taking so much of my time.

I'll let you know what I find.

Suzie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp