Extending a style across multiple paragraphs

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Calybos
Propeller Head
Posts: 44
Joined: Tue Jun 17, 2014 5:20 am

Extending a style across multiple paragraphs

Post by Calybos »

Hi, folks. We’ve got a neat little Note style in our stylesheet that sets off the text in a shaded border box with an icon (see below).

Image

Works great, but we need to extend that style to cover multiple lines, such as a bulleted list, and have them all stay bounded by the same box with a single icon. Any suggestions on how to do that?

Caveat: Code is a black box to me; as soon as you say “use a div,” I’m lost. Here’s the original details from the stylesheet:

p.Note
{
background-repeat: no-repeat;
border: solid 1px #404040;
border-radius: 6px;
padding-bottom: 10px;
padding-right: 10px;
padding-top: 10px;
color: #424342;
background-color: #c7e6f9;
padding-left: 50px;
mc-auto-number-format: '{b}{color #424342}Note: {/color}{/b}';
background-image: url('../Images/_standard/NoteIcon.png');
}
kwag_myers
Propellus Maximus
Posts: 810
Joined: Wed Jul 25, 2012 11:36 am
Location: Ann Arbor, MI

Re: Extending a style across multiple paragraphs

Post by kwag_myers »

Make a copy of the p.Note style and change it to div.Note. I haven't figured out how to add div's in the XML Editor yet, so I always do it in the Text Editor:

Code: Select all

        <div class="Note">
            <p>paragraph 1</p>
            <p>paragraph 2</p>
            <p>paragraph 3</p>
            <p>paragraph 4</p>
            <p>paragraph 5</p>
            <p>paragraph 6</p>
        </div>
Results in:
DivNote.png
You do not have the required permissions to view the files attached to this post.
"I'm tryin' to think, but nothin' happens!" - Curly Joe Howard
Calybos
Propeller Head
Posts: 44
Joined: Tue Jun 17, 2014 5:20 am

Re: Extending a style across multiple paragraphs

Post by Calybos »

Okaaaayyy... and what would a "div" style look like in the stylesheet code? Will we be able to select it from the Available Styles list on the Styles window?

Black box.
emsachs
Propeller Head
Posts: 91
Joined: Wed Nov 19, 2014 12:49 pm

Re: Extending a style across multiple paragraphs

Post by emsachs »

you would change it to:

div.Note
{
background-repeat: no-repeat;
border: solid 1px #404040;
border-radius: 6px;
padding-bottom: 10px;
padding-right: 10px;
padding-top: 10px;
color: #424342;
background-color: #c7e6f9;
padding-left: 50px;
mc-auto-number-format: '{b}{color #424342}Note: {/color}{/b}';
background-image: url('../Images/_standard/NoteIcon.png');
}

everything the same, except change p to div.

divs are applied a little differently from other styles. To apply a div in the XML editor, highlight the paragraphs you want in the div, press Tab, and a little dialog box pops up that lets you choose your div.

A div is a kind of container. I guess my internal image of it is as a big single celled table, that lets you set the kinds of properties you could set in a Body, where everything inside gets its properties from the div.

Here's the first hit on google from someplace called www.tizag.com
The <div> tag is nothing more than a container unit that encapsulates other page elements and divides the HTML document into sections. Web developers use <div> elements to group together HTML elements and apply CSS styles to many elements at once.
kwag_myers
Propellus Maximus
Posts: 810
Joined: Wed Jul 25, 2012 11:36 am
Location: Ann Arbor, MI

Re: Extending a style across multiple paragraphs

Post by kwag_myers »

I don't know what happened to the last few posts on this thread, but I found that you can use soft returns (Shift+Enter) within the p.Note style tags to accomplish what you are after.
"I'm tryin' to think, but nothin' happens!" - Curly Joe Howard
kkelleher
Sr. Propeller Head
Posts: 163
Joined: Wed Nov 12, 2008 12:42 pm

Re: Extending a style across multiple paragraphs

Post by kkelleher »

kwag_myers wrote:I don't know what happened to the last few posts on this thread
The forums suffered some kind of melt-down yesterday evening. Looks like they lost everything going back to Tuesday evening.

Thanks,

Kristen
Kristen Kelleher
Director of Tech Pubs, TIBCO Jaspersoft
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Extending a style across multiple paragraphs

Post by doc_guy »

Yeah. The <div> is a container element. So you apply the note style to the div, and then you have a bunch of paragraphs or lists (or even images or a table) inside the div.

In your stylesheet you need to create a div with a class of 'note' or whatever, and copy the styles from your p.note style into your div.note style.

Now, write several paragraphs of text. include a bulleted list for good measure. Now select all that content. While it is selected, press the Tab key on your keyboard. You should see the "group" popup which will allow you to select a way to group the selected content. Click on your div.note style, and you should see the results you need.

On a side, but related, note, DIVs are also ideal for indenting content.

In your stylesheet create a div with a class of 'indent'. On that div, set a style for padding-left: 20px; or something similar (the number doesn't matter, so you'll probably adjust this to match whatever size you want).

Now when you need to indent any content in Flare, select it, and press the TAB key and from the 'group' popup, select div.indent. You can do it multiple times if you need to indent several layers.

Far too often people create P.Note and P.NoteIndent and P.NoteIndentMore and P.Important and P.ImportantIndent and table.indent and image.indent -- all to provide indenting in their topics. Don't do that! Just nest your content in div.indent and you only have to create P.Note and P.Important. If you need to indent a p.note or a p.important, then you select it, press TAB and add the div.indent as a parent. SO much easier!

When you are trying to style content for online output (in Flare or elsewhere) DIVS are your friend!
Paul Pehrson
My Blog

Image
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Extending a style across multiple paragraphs

Post by ChoccieMuffin »

I think there was a bit of a hiccup with the forums on Friday, as I had posted a note that has now disappeared.

Be careful using DIVs if your output is Word, as Word doesn't support DIVs (this was confirmed by a more experienced user whose post has also disappeared!)
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Calybos
Propeller Head
Posts: 44
Joined: Tue Jun 17, 2014 5:20 am

Re: Extending a style across multiple paragraphs

Post by Calybos »

OK, now how do you end a div once you're in it? Selecting a p. style from the Available Styles list isn't doing it.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Extending a style across multiple paragraphs

Post by Nita Beck »

Calybos wrote:OK, now how do you end a div once you're in it? Selecting a p. style from the Available Styles list isn't doing it.
With the cursor in that last paragraph that you want to move out of the div, press Shift+Tab.
or
Right-click that last paragraph block and select Move Left.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Extending a style across multiple paragraphs

Post by doc_guy »

Or you can use your down curser to move down until you are out of the div, and then keep typing.
Paul Pehrson
My Blog

Image
Post Reply