Presentation is loading. Please wait.

Presentation is loading. Please wait.

MadCap Flare – Controlling Document Look and Feel with CSS

Similar presentations


Presentation on theme: "MadCap Flare – Controlling Document Look and Feel with CSS"— Presentation transcript:

1 MadCap Flare – Controlling Document Look and Feel with CSS
Mike Hamilton V.P. Product Management MadCap Software

2 Slides Slides are available on Mike’s blog at:

3 What are Cascading Stylesheets (CSS)?
Agenda What are Cascading Stylesheets (CSS)? CSS Basics CSS Rules Inheritance Cascading Classes Spans and Divs Creating a Stylesheet in Flare Flare Stylesheet editor overview

4 Agenda Modifying styles Applying styles to content Applying a style sheet to topics Fonts and Font Families Font sizing Creating a style class

5 Cascading Stylesheets
Introduction

6 What Are Cascading Stylesheets?
A Cascading stylesheet (CSS) document is a simple text file. A CSS file contains a collection of style rules used to control the look and feel of documents. A CSS style rule has two parts, a Selector and a Declaration

7 Cascading Style Sheets (CSS)
Style Rules Property Value H1 {font-weight: bold} Selector Declaration H1 {font-weight: bold; color:black; }

8 XHTML elements inherit style attributes <body>
CSS Inheritance XHTML elements inherit style attributes <body> <p>Sample text</p> </body> body { font-family: Arial; }

9 HTML Page Structure Document (HTML) Head Title Body H1 Heading
Paragraph 1 Paragraph 2 Title

10 Three CSS implementations
Cascading Three CSS implementations External Linked to an unlimited number of files Embedded Affects only the elements in a specific file Inline Affects only the element applied to

11 Linked (external) style sheets
Cascading Order of precedence Inline styles Embedded style sheets Linked (external) style sheets EXAMPLE: BASIC.HTM Go through the entire file and describe all of it – especially style sheets

12 Use the STYLE attribute <p>This is normal text</p>
Inline CSS Use the STYLE attribute <p>This is normal text</p> <p style=“font-weight: bold”>This is bold text</p> Creates a unified look between all of your documents Provides a very easy way to change the look of several documents at once (templates) You can define characteristics for specific tags, the a subset of items with a specific tag, or all items in a “class” External vs. Embedded Embedded applies only to the current page External (“linked”) applies to all pages that are linked to it The examples in this talk use embedded so we can stay in one file Values that can be affected by a style sheet: Paragraph-level (margins, padding, border) Character-level (font, color, background color, position) Some of the attributes can be either character or paragraph level.

13 Embedded CSS Added to the <HEAD> area of file Use <STYLE> element <HEAD> <TITLE>New Topic1</TITLE> <STYLE>H1{font-weight:bold}</STYLE> </HEAD>

14 External CSS The <LINK> element is used to attach a CSS document to an HTML document <LINK REL="StyleSheet” REF=”example.css"> Rel=related

15 CLASS attribute CLASS attribute can be used to create custom styles for a set of items on a page P { color:blue; margin-left:3px; } P.myclass { color:blue; margin-left:3px; } This is an easy way to affect a group of items (within a tag group or outside of tag groups) EXAMPLE: CLASS.HTM Add: P.SpecialPClass { font-weight : bold; font-size : 18pt; color : Maroon; } to style sheet Add: .GeneralClass { color : red; } to style sheet Add: CLASS="GeneralClass“ to H3 tag Add: <SPAN CLASS="GeneralClass"> around “Wednesday” in 1st paragraph Replace: <P>Dow Jones</P> with <DIV ID="DowJones"> <P CLASS="SpecialPClass">Dow Jones</P> </DIV> Show: New York – H3 Wednesday – SPAN Dow Jones - DIV

16 CLASS attribute Class Syntax: In a style sheet:
P.myclass { color:blue; margin-left:3px; } In a page: <P CLASS=“myclass”>Text</P> This is an easy way to affect a group of items (within a tag group or outside of tag groups) EXAMPLE: CLASS.HTM Add: P.SpecialPClass { font-weight : bold; font-size : 18pt; color : Maroon; } to style sheet Add: .GeneralClass { color : red; } to style sheet Add: CLASS="GeneralClass“ to H3 tag Add: <SPAN CLASS="GeneralClass"> around “Wednesday” in 1st paragraph Replace: <P>Dow Jones</P> with <DIV ID="DowJones"> <P CLASS="SpecialPClass">Dow Jones</P> </DIV> Show: New York – H3 Wednesday – SPAN Dow Jones - DIV

17 Spans Spans format text within an element such as a paragraph, list, or table Conceptually similar to character styles in MS Word/FrameMaker <p>This paragraph has a <span style="font-weight: bold”> boldfaced</span> word.</p> This paragraph has a boldfaced word.

18 Divs Divs allow for grouping many elements together <div class=“indent”> <p>Paragraph 1</p> <p>Paragraph 2</p> <p>Paragraph 3</p> </div>

19 Using Cascading Stylesheets in Flare

20 Creating a Stylesheet Select Project>Add Stylesheet

21 Creating a Stylesheet In the Template Folders section select Factory Templates. In the Templates section, select one of the CSS template files available. If necessary, select an alternate folder for storing your new stylesheet. In the File Name field, type a name for the stylesheet. Click Add. Click OK.

22 Modifying a Style Open a stylesheet. By default stylesheets are stored in the Resources folder in the Content Manager view. When the stylesheet editor opens you can work in either the Simplified or Advanced view. tour In the simple view, double click on the style you wish to edit. Select a tab. Select a style property to change. Click OK.

23 Select View> Style Window. The Styles window appears.
Applying a Style Open a topic. Select or click inside the content to which you want to apply the style. Select View> Style Window. The Styles window appears. Click a style to apply. The style is applied to the selected content

24 Applying a Stylesheet to a Topic
Open the topic that you want to link to the stylesheet. Select Tools>Stylesheet Links. The Stylesheet Links dialog box appears.

25 Applying a Stylesheet to a Topic
Select a stylesheet. Click . The stylesheet is added to the list on the left. Click OK. The stylesheet is applied to the topic.

26 Font Family What is a Font Family?
A list of alternate fonts for styles used in your project Why are Font Families important? Many fonts on your authoring workstation may not be available on the end users’ If you use a font in your Help system that does not exist on the users’ workstation, then the browsers pick what font to use! Font sets allow you to define a list of alternate fonts for those used in the style sheets referenced by your topics. The browser or display device will attempt to use the primary font in the font set. If it can’t find the primary font on the users system, then it will try to use the other fonts in the font set in the order they are listed. All operating systems have a unique set of system fonts and font names. Many of the fonts on your authoring workstation may not be available on the users systems. Depending on your knowledge of your users and their system configurations, you will determine which font to define as the primary font, and how many alternatives you need to provide. In this example, we will create a font set that uses a Windows system font as the primary, but also calls a Macintosh system font and a generic font type for other operating systems.

27 Font Family Guidelines Define primary font
Define secondary fonts for other operating systems (UNIX, Macintosh, etc.) Order is critical – list is hierarchical Note: Font sets are saved with a project

28 Font Family Fonts Common to an OS Microsoft Windows Macintosh Times
Arial Comic Sans MS Courier New Marlette Symbol Times New Roman Wingdings Microsoft Windows Times Courier Helvetica Symbol Chicago New York Geneva Monaco Palatino Macintosh These are lists of standard fonts that should be available on all Windows and Mac operating systems

29 Recommended Font Families
Font Family Recommended Font Families Arial, Helvetica, Sans-serif Verdana, Arial, Helvetica, Sans-serif Times New Roman, Times, Serif Courier New, Courier, Mono

30 Creating a Font Family in Flare
Demo Creating a Font Family in Flare

31 Font Sizing There are two ways to define font sizes in an HTML environment Fixed Font Sizing Relative Font Sizing

32 Font Sizing Fixed Font Sizing
Fixed Font Sizing defines the size of fonts using absolute units such as points (pt), picas (pc), inches (in), centimeters (cm), etc. Because of the differences in how various types of computers display content, Fixed Font Sizing will ALWAYS cause fonts to display smaller on some systems (like the Macintosh) Tips: Various operating systems display fixed text sizes very differently. The 10 pt text that looks good on your desktop machine will require a magnifying glass to read on a Macintosh. This is due to differences in how operating systems render fixed size fonts. Fixed size fonts will always render differently on different platforms. This is due to different operating systems having different standards for the default points per inch (ppi).

33 Font Sizing Relative Font Sizing
Relative Font Sizing defines the size of fonts using relative units such as percentages (%), the em unit (em), numerical values (1-7), and descriptive values (xx-small - xx-large), etc. Relative sizes refer to the font size of the parent element. This allows fonts to scale appropriately to different resolutions, browsers or platforms

34 Relative Font Size Guidelines
Font Sizing Relative Font Size Guidelines Define the size for the normal style as 100% to provide consistent looking, legible text on any platform Define heading styles as a percentage of the normal text – e.g. Heading 1=120%, Heading 2=115%, etc. Defining the size info for the normal style as 100% will force the browser or display device to render normal text in the browsers default text size. You can then define various heading sizes as a percentage of the normal text – e.g. 115%. Since individual browsers are written to a particular operating systems, they already take the differing ppi standards into consideration. Using the default browser text size (or a percentage of the default) should provide consistent looking, legible text on any platform.

35 Setting Relative Font Sizes
Font Sizing Demo Setting Relative Font Sizes in Flare

36 Creating a Style Class Open a stylesheet. If the Stylesheet Editor opens to the Simplified view, click Advanced View. Select the p style. Click Add Class in the Stylesheet Editor toolbar. The New Style dialog box appears. Type a name for the style.

37 Creating a Style Class Click Create Style. The Create Style dialog box appears. In the Name field, type a name for the new style without using spaces.

38 Creating a Style Class If you do not want to include a style property in the new style, click the check box next to the value to remove the checkmark. If you want the new style to be applied to the selected content, select Create style and update the source element. If you do not want the new style to be applied to the selected content, select Create style without updating the source element. Click OK. The new style is added to the stylesheet.

39 Auto-Numbering Auto-Numbering can be used to allow for automated figure or table numbers, for government style paragraph numbering, or for automatically generating chapter numbers Create a custom style class Add auto-numbering to the style class Use the new style class in the Master Page Link Update the content master page to use auto-numbering to automatically add chapter numbers to every page.

40 Cross-References Cross-references allow for an extremely elegant single-source handling of linking Controlled by CSS Can look like standard hyperlinks for online publishing Converted to proper page number references when going to print Link

41 Suggested Reading List
Watch all of the built in Flare tutorial videos. Read as much of the online help overview information as I could handle. Build a couple or three test projects to get a feel for what is going on. Coming from RoboHelp, get a copy of Scott's great book. MadCap Flare for RoboHelp Users by Scott DeLoach ISBN-13:  

42 Suggested Reading List
HTML, XHTML, and CSS, Sixth Edition (Visual Quickstart Guide) by Elizabeth Castro ISBN-13: Technical Writing 101: A Real-World Guide to Planning and Writing Technical Documentation by Alan S. Pringle and Sarah O'Keefe ISBN-13: CSS: The Definitive Guide, Second Edition by Eric Meyer ISBN-13: DHTML and CSS for the World Wide Web, Third Edition (Visual Quickstart Guide) by Jason Teague ISBN-13:

43 Questions?


Download ppt "MadCap Flare – Controlling Document Look and Feel with CSS"

Similar presentations


Ads by Google