Aligning the icon with text in Togglers

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
todd.richardson
Sr. Propeller Head
Posts: 184
Joined: Thu Aug 07, 2008 6:43 am
Location: Massachusetts

Aligning the icon with text in Togglers

Post by todd.richardson »

Hello,

The button icon in a toggler does not seem to align properly with the toggler text, as shown in the image below. Is anyone aware of a way to force the icon and text to align? I've played with stylesheet properties for the MadCap | toggler style in my stylesheet but can't seem to figure it out.

Image

Thanks in advance. And please excuse me if this topic has been covered elsewhere. A search on "Toggler" did not return anything that related to this issue.

/Todd
Last edited by todd.richardson on Mon Aug 18, 2008 12:45 pm, edited 1 time in total.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero

Windows 10, Flare 2020
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Aligning the icon with text in Togglers

Post by KevinDAmery »

Haven't seen that before - mine are in line with the text and I didn't do anything specific to get that. Could you post the code in your CSS for the togglers so we can see if there is anything unusual?
Until next time....
Image
Kevin Amery
Certified MAD for Flare
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Aligning the icon with text in Togglers

Post by doc_guy »

I'd also like to see the HTML/XML code that is generating that behavior to ensure that there isn't stray code in there someplace. For example, if you have a nested <p> tag, the top margin of the <p> element in the CSS will be added to the nested <p> element, which is one possible explanation of why you are seeing this behavior.
Paul Pehrson
My Blog

Image
todd.richardson
Sr. Propeller Head
Posts: 184
Joined: Thu Aug 07, 2008 6:43 am
Location: Massachusetts

Re: Aligning the icon with text in Togglers

Post by todd.richardson »

From the stylesheet opened in Notepad:

MadCap|toggler
{
color: #00608a;
font-family: 'Avenir LT 55 Roman';
font-size: 8pt;
text-transform: uppercase;
mc-image-spacing: 5px;
}


Let me know if there is any other relevant code that would be helpful.

Thanks,
/Todd
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero

Windows 10, Flare 2020
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Aligning the icon with text in Togglers

Post by doc_guy »

doc_guy wrote:I'd also like to see the HTML/XML code that is generating that behavior to ensure that there isn't stray code in there someplace. For example, if you have a nested <p> tag, the top margin of the <p> element in the CSS will be added to the nested <p> element, which is one possible explanation of why you are seeing this behavior.
I still want to see how the code is constructed here to see if you have any nested elements that might affect the style.
Paul Pehrson
My Blog

Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Aligning the icon with text in Togglers

Post by LTinker68 »

Actually, the last line in your style is the problem. The mc-image-spacing is moving the image up 5px in relation to the text. Get rid of that property and you should be closer.

Personally, I did my own toggler images because even if you take out that line of code, you're going to see a shift in the toggler icon because the open image is a different size (width x height) than the closed image. So I made my own that are the same dimensions so that they don't shift.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
todd.richardson
Sr. Propeller Head
Posts: 184
Joined: Thu Aug 07, 2008 6:43 am
Location: Massachusetts

Re: Aligning the icon with text in Togglers

Post by todd.richardson »

The mc-image-spacing: 5px; property determines the distance, or space, between the icon and text, not the height.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero

Windows 10, Flare 2020
todd.richardson
Sr. Propeller Head
Posts: 184
Joined: Thu Aug 07, 2008 6:43 am
Location: Massachusetts

Re: Aligning the icon with text in Togglers

Post by todd.richardson »

doc_guy wrote:I still want to see how the code is constructed here to see if you have any nested elements that might affect the style.
I tried attaching the code in a .txt file, but it was not allowed. What is the best way to share the code with you?
Thanks for your help.

/Todd
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero

Windows 10, Flare 2020
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Aligning the icon with text in Togglers

Post by LTinker68 »

todd.richardson wrote:The mc-image-spacing: 5px; property determines the distance, or space, between the icon and text, not the height.
Oh, sorry. There are spacing options for the img tag for vertical and horizontal positioning and I thought the mc style was doing that. Wonder why they created their own property? Guess it was to combine two different types of tags into one.

As for the code, I think they're asking you to just open the topic in the Internal Text Editor or Notepad and copy-and-paste the HTML code for the toggler, and if it's contained inside another tag (like a <div> or <p> tag) then to include that tag, too. And if it is contained within another tag (at least a <p> tag), then include the style for that tag in the post, too, so they can judge how they're being combined in the topic.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
todd.richardson
Sr. Propeller Head
Posts: 184
Joined: Thu Aug 07, 2008 6:43 am
Location: Massachusetts

Re: Aligning the icon with text in Togglers

Post by todd.richardson »

Here is the topic code (actual paragraph content replaced by the word "Text"):

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="3" MadCap:lastHeight="458" MadCap:lastWidth="590">
    <head>
    </head>
    <body>
        <h1>Funds Transfer Pricing (FTP)<MadCap:keyword term="Funds Transfer Pricing;Net Interest Income;Asset Liability;Reporting;Planning;Risk:Funding" /><MadCap:concept term="Asset/Liability;Funds Transfer Pricing" /></h1>
        <p>Text</p>
        <p>Text</p>
        <p>
            <MadCap:toggler targets="Funds Transfer Pricing (FTP) Expanded">More Information</MadCap:toggler>
        </p>
        <div MadCap:targetName="Funds Transfer Pricing (FTP) Expanded">
            <p>Text</p>
        </div>
        <p>
            <MadCap:conceptLink term="Asset and Liability;Asset/Liability" externalHelpSystems="" />
        </p>
    </body>
</html>
Thanks.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero

Windows 10, Flare 2020
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Aligning the icon with text in Togglers

Post by LTinker68 »

Weird. I copied your topic code and your style code into my project and the toggler hotspot text appears on the same line as the toggler icon. The only difference is that I don't have that font on my system, so I think it just ignored it. Try specifying a different font and see if that helps.

BTW, you shouldn't use a non-common font like that unless you're installing it on the user's computer along with your application. You should use a font-family of "Verdana, Arial, Helvetica, sans-serif", or something similar.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Aligning the icon with text in Togglers

Post by doc_guy »

What styles do you have in your stylesheet for the <p> element? What do you have in your stylesheet for the <div> element?

I think that may be where the problem lies, but I'm not sure.
Paul Pehrson
My Blog

Image
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Aligning the icon with text in Togglers

Post by KevinDAmery »

LTinker68 wrote:BTW, you shouldn't use a non-common font like that unless you're installing it on the user's computer along with your application. You should use a font-family of "Verdana, Arial, Helvetica, sans-serif", or something similar.
Just to expand on Lisa's point for those who aren't familiar with it, the issue is that online help formats don't embed fonts into the help system - instead, they just use the fonts that already exist on the user's computer. This poses a problem if you want to use fonts that don't come with Windows, Mac OS, or whatever platform it is your application runs on, because you can't guarantee the user will have the font you specify. If they don't have it, the help system reverts to whatever the default font is for the system.

For this reason, it's best to use fonts that are included by default with the OS - on the Windows side, this would include fonts like Verdana, Arial, and Times New Roman, and on the Mac side it would include Helvetica, Geneva, and Times (I think - it's been many moons since I've used a Mac so I may have a few mistakes in there). Of course, if your application installs a font on the user's system, then you can safely use that font as well.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
Post Reply