Span a whole paragraph?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Span a whole paragraph?

Post by QuadraQ »

OK this doesn't come up a whole lot, but when it does it's annoying.

I have a span class that is used for emphasis and bolds the text. Occasionally I have a short paragraph that I want to emphasize, and I want to set the span for all the text in the paragraph. However when I select the text (the entire paragraph in this case) the only styles that show up for me to apply are paragraph styles, the span classes disappear. I can select half of it and apply the span, then select the second half and apply the span, but I don't understand why the span classes disappear from the available list in the first place. Is this some sort of CSS limitation?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Span a whole paragraph?

Post by LTinker68 »

It's not a CSS limitation so much as, in this case at least, Flare is trying to streamline your code. You shouldn't need to span an entire paragraph; instead, you should apply a class to the paragraph tag. A span is only for a portion of text in a parent tag -- it's not for the entire parent tag.

What you might want to do instead is to open the stylesheet file in the Internal Text Editor, and delete the "span" from in front of that span class. For instance, if your span class is called "span.boldItalic", change it to be named ".boldItalic". You've just changed a span-specific style (one that can only be used on spans) into a generic class, which can then be applied to any tag. Well, any tag where you can insert text. So you can use the same generic class for the entire paragraph (p class="boldItalic") or for selected text in a paragraph (span class="boldItalic"). Generic classes appear at the top of the Styles pane. Unfortunately, you can't yet create a generic class from within the Stylesheet Editor, so you have to add them (or in your case, rename it) in the stylesheet file via the Internal Text Editor or Notepad.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Span a whole paragraph?

Post by QuadraQ »

OK I don't want to argue semantics, but I'm going to anyway. :wink:

If a span is for a number of characters that certainly could include the entire paragraph class. I agree that if this is the predominate case you're using it wrong. But for the occasional case, I don't see anything wrong with this. A paragraph is a portion of text along with some other properties. I don't think Flare is handling this right.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Span a whole paragraph?

Post by Andrew »

Actually, it does work fine. Here's the secret:

You need to not "go past" the end of your paragraph. When you highlight, make sure you do not select anything beyonnd the final character (go back one and then forward one again to make sure you only got that one character) and you should still see the span styles.

Hope that helps.
Flare v6.1 | Capture 4.0.0
Ryan Cerniglia

Re: Span a whole paragraph?

Post by Ryan Cerniglia »

QuadraQ wrote:OK I don't want to argue semantics, but I'm going to anyway. :wink:

If a span is for a number of characters that certainly could include the entire paragraph class. I agree that if this is the predominate case you're using it wrong. But for the occasional case, I don't see anything wrong with this. A paragraph is a portion of text along with some other properties. I don't think Flare is handling this right.
And if (X)/HTML (1.1)/4.01 was designed for print tools, you might be right :wink:

The difference in reasoning has to between a block and an inline in the document structure. Paragraphs (p) are block level elements meant to go in the body tag. On the other hand, text spans (span) are inline level elements meant to fit inside of a block tag. Semantically speaking, you're not supposed to "stack" block level elements such as p tags, and you're not supposed place inline level elements such as span tags in the body tag.

Having the code...

Code: Select all

<p><span class="shiny">This is some shiny text!</span></p>
... isn't any semantically better than...

Code: Select all

<p class="shiny">This is some shiny text!</p>
Granted, semantically speaking in 99.9% of circumstances you don't want to even use a span tag...
Post Reply