Local (or inline) formatting very basic question from newbie

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
rogersm
Sr. Propeller Head
Posts: 106
Joined: Fri Nov 07, 2014 4:29 am

Local (or inline) formatting very basic question from newbie

Post by rogersm »

Hi there,

I am aware that this is probably a ridiculous question, but I am just on a demo trial of Flare since today and just having a look around it. The Flare documentation mentions that local (or inline) formatting is not recommended and to use styles instead.
So if I want to apply bold font to a piece of text from the Ribbon, I could select the Home tab and select B from the Font group. But this is local (or inline) formatting.
So if I want to use a style, do I select the Home tab and select "b" from the Style drop down list in the Style group? If this is correct, there is an Unformat icon in the Font group that seem to remove inline formatting and so seems to remove this style.
Again, sorry for so basic a question.

thanks,
mark
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Local (or inline) formatting very basic question from newbie

Post by SteveS »

Hi Mark,

Welcome to the forums :D

You probably need to do a crash course in HTML/ CSS.

Basically when it comes to styling elements in HTML (or in Flare's case XHTML) you can either apply your styles inline or you can use named styles. Named styles can be defined in the header of a HTML document or in a cascading style sheet (CSS) referenced in the header of the document.

Using inline styles is quick and easy but creates a maintenance nightmare. CSS allows you to change your styles in one place without having to hunt down every instance. Styling in the document header is OK for a single document, but a separate style sheet can be used by many documents.

The bold example is probably not the best as it is usually used in inline formatting. Even if you were to create a class called (for example) LookAtMe which was just your regular font with a bold font-style you are likely to apply it to words or phrases only, rather than entire paragraphs. The only advantage in making a class rather than applying bold inline is you might change your mind later on and decide that you will emphasise text by making it red, rather than bold.

Have a look at http://www.w3schools.com/css/css_intro.asp, click next chapter to progress. Its probably worth taking a couple of hours out of the time evaluating Flare to get a grasp of CSS. Many of the comments about Flare being a steep learning curve are actually HTML/CSS related, rather than the tool itself. And, as HTML/CSS is a standard commonly used in this industry it will be time well spent!
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Local (or inline) formatting very basic question from newbie

Post by NorthEast »

It's not such a ridiculous question.
It's good practice that the HTML should define the content/structure of the page, and the stylesheet CSS defines how it looks.

However, tags like bold (b), italic (i), and underline (u) are a bit of a grey area, since they already have an implied style. If you use these, they will insert a tag, rather than inserting an inline style like style="...". For example, bold inserts the b tag, not a span with style="font-weight: bold;".

Ideally, it's best to set up your styles based on what they're used for, rather then how they look. For example, if you want to refer to something in the interface like "click OK", rather than just using bold, you could set up a style called span.interface. Then if you later want to change the style, e.g. make it green instead of bold, it's easier to change span.interface in the CSS rather than search through your project and replace things marked in bold.
rogersm
Sr. Propeller Head
Posts: 106
Joined: Fri Nov 07, 2014 4:29 am

Re: Local (or inline) formatting very basic question from newbie

Post by rogersm »

Hi,

Thanks to both of you for the replies. Very helpful.

thanks,
mark
Post Reply