Applying one character style on top of another
Applying one character style on top of another
Hi there,
I would like to keep a previously applied character style when selecting a new one on top ... I give an example:
Let's say I have the text "I like apples." First I apply my span.italic to the 'like'. (I like apples.) Then I want to apply span.bold to all three words.
Now in my project, when I do that, all three words are bold but my italic style is gone: I like apples.
What do I have to do to keep the previously selected style?
I like apples.
Thanks
Heike
I would like to keep a previously applied character style when selecting a new one on top ... I give an example:
Let's say I have the text "I like apples." First I apply my span.italic to the 'like'. (I like apples.) Then I want to apply span.bold to all three words.
Now in my project, when I do that, all three words are bold but my italic style is gone: I like apples.
What do I have to do to keep the previously selected style?
I like apples.
Thanks
Heike
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Applying one character style on top of another
Easiest would be to create another style that is bold and italic and then apply it to the applicable characters.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Applying one character style on top of another
There is another alternative that's CSS-supported and is used in v8 a lot, but it seems like I had problems with it in earlier versions, but that could just be that it didn't display correctly in the XML Editor -- I don't remember if I ever actually built the output to test. That other option is to add both classes to the span tag, which requires editing the topic in the Internal Text Editor since you can't apply both classes via the XML Editor. So the tag would look something like <span class="italic bold">I like apples</span>.
However, I think RamonS's option of a new class that's italic and bold would be easier. That's what I do.
However, I think RamonS's option of a new class that's italic and bold would be easier. That's what I do.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Applying one character style on top of another
Hi there,
Thanks for your suggestions.
What I don't understand is why applying the second style deletes the first one?
When I format text as "bold" using the tool bar and then format the whole sentence as "italic", the bold word stays bold. Why doesn't that work with styles, too?
And when I apply the styles the other way round, it works, too (first the sentence then the word).
It does not seem to be logical behaviour ...
Greetings
Heike
Thanks for your suggestions.
What I don't understand is why applying the second style deletes the first one?
When I format text as "bold" using the tool bar and then format the whole sentence as "italic", the bold word stays bold. Why doesn't that work with styles, too?
And when I apply the styles the other way round, it works, too (first the sentence then the word).
It does not seem to be logical behaviour ...
Greetings
Heike
Re: Applying one character style on top of another
Flare will "layer" your styles so that certain words will carry multiple formats.
CSS, on the other hand, will not; it considers a style assignment as a "one-or-the-other" format.
Both logical, only different.
Good luck,
Leon
CSS, on the other hand, will not; it considers a style assignment as a "one-or-the-other" format.
Both logical, only different.
Good luck,
Leon
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Applying one character style on top of another
My only guess is that a style definition is an absolute, it changes what you specified and everything else is default. I think that is how it should work, because otherwise you get into situations with styles that specify incompatible settings. For example, font size. One style states it should be 10 pt and the other one requests 12 pt. What should a browser do? Show 11 pt as compromise? The absence of a setting doesn't mean it can be ignored. If that is the case you'd get everything in bold, italic, underlined, red, striked through, 48 pt, etc. just because it was not defined to not to be like that.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Applying one character style on top of another
It's nothing to do with CSS that's the problem here, the Flare XML editor is actually removing the original tag.
Select a word and apply a span tag. Then select a a few words including the original span tag, and apply a second span tag. When you apply the second span tag, the first tag is removed altogether.
I would call that a bug; it shouldn't remove the first tag.
You can only do this the other way round; i.e. insert the second span tag inside the first.
Select a word and apply a span tag. Then select a a few words including the original span tag, and apply a second span tag. When you apply the second span tag, the first tag is removed altogether.
I would call that a bug; it shouldn't remove the first tag.
You can only do this the other way round; i.e. insert the second span tag inside the first.
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Applying one character style on top of another
And what should it do when the styles define conflicting settings? When one style only defines for text to be italic then that implies that it is also not to be bold, underlined, etc. While it is allowed to have a construct such as <span>...<span>...</span>...</span> I wouldn't count on browser properly handling it.Dave Lee wrote:I would call that a bug; it shouldn't remove the first tag.
I used this sample page:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Title</title>
</head>
<body>
<p>
<span style="color:lightblue">Test<span style="color:green">Nest span</span>Test</span>
</p>
</body>
</html>
I like apples.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Applying one character style on top of another
mmmmhhh ...
The closer, the more specific, means: In a conflicting case I'd expect the browser to prefer the inner style to the outer one.
Since it's allowed to use a span inside a span in XHTM, I don't know why it doesn't work - report it as a bug.
But bold and italic are not contradicting each other ... and a construct like described above is possible and if you use the toolbar buttons (instead of span styles), no matter what way round you apply them. It's just with spans ...
The closer, the more specific, means: In a conflicting case I'd expect the browser to prefer the inner style to the outer one.
Since it's allowed to use a span inside a span in XHTM, I don't know why it doesn't work - report it as a bug.
But bold and italic are not contradicting each other ... and a construct like described above is possible and if you use the toolbar buttons (instead of span styles), no matter what way round you apply them. It's just with spans ...
Inge____________________________
"I need input! - Have you got input?"
"I need input! - Have you got input?"
Re: Applying one character style on top of another
The styles set for the spans is irrelevant.RamonS wrote:And what should it do when the styles define conflicting settings? When one style only defines for text to be italic then that implies that it is also not to be bold, underlined, etc. While it is allowed to have a construct such as <span>...<span>...</span>...</span> I wouldn't count on browser properly handling it.
The main point here is that Flare isn't allowing you create the tag construct in the first place; it's removing the interior span tag when you apply them in that order.
Besides, the CSS properties in question don't actually conflict; italic is set using font-style and bold is set using font-weight. They're different properties, so there's no reason you can't have both; in your example you're talking about the same property (color), so you obviously can't have both for that.
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Applying one character style on top of another
My point is that by not setting a property it is implied that the default is to be used, but it all comes down to a better test. I modified the one line in the example as such: span style="font-weight:bold">Test<span style="font-style:italic">Nest span</span>Test</span>
To my surprise, IE, FF, and Safari mix the styles as was asked for although nowhere did I specify anything to be bold AND italic. Seems to come down to some sort of inheritance, which I did not expect to be present.
That said, I am no longer disagreeing and see why this is a bug, although one with a somewhat simple and more explicit workaround by using a style that specifies both bold and italic.
To my surprise, IE, FF, and Safari mix the styles as was asked for although nowhere did I specify anything to be bold AND italic. Seems to come down to some sort of inheritance, which I did not expect to be present.
That said, I am no longer disagreeing and see why this is a bug, although one with a somewhat simple and more explicit workaround by using a style that specifies both bold and italic.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Applying one character style on top of another
Hi there,
thanks about all the research and information. I think the problem is neither if the formatting makes sense nor how it will be displayed in a browser.
If it was not allowed to use a span tag inside of another span tag, it should never be allowed. But generally it IS allowed: It works when I do it the other way round: first the sentence, second the word. So for me it makes no sense deleting the "word" tag when applying the "sentence" tag.
I reported it as a bug.
Let's see.
Thanks a lot!
Heike
thanks about all the research and information. I think the problem is neither if the formatting makes sense nor how it will be displayed in a browser.
If it was not allowed to use a span tag inside of another span tag, it should never be allowed. But generally it IS allowed: It works when I do it the other way round: first the sentence, second the word. So for me it makes no sense deleting the "word" tag when applying the "sentence" tag.
I reported it as a bug.
Let's see.
Thanks a lot!
Heike