daniel ferguson · class p.note id p#intro pseudo classes a:active a:focus a:hover a:link a:visited...

15
Selecting the right selector Taking Advantage of Advanced CSS Selectors in MadCap Flare Daniel Ferguson MadCap Flare Trainer & Consultant Founder, Smart Output

Upload: others

Post on 09-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Selecting the right selectorTaking Advantage of Advanced CSS Selectors in MadCap Flare

Daniel FergusonMadCap Flare Trainer & Consultant

Founder, Smart Output

Page 2: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Daniel Ferguson

MadCap Flare Trainer & Consultant

Founder, Smart Output

smartoutput.com

[email protected]

@ferg_daniel

linkedin.com/in/DanielSFerguson

Page 3: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Agenda1. Basic CSS review

2. CSS in Flare stylesheet editor

3. CSS selector demonstration

4. Creating advanced selectors in

Flare

5. Examples from real projects

Page 4: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

h1

{

color: blue;

}

Anatomy of a CSS rule

Selector

Declaration

Property Value

The selector points to the HTML element you want to style

Page 5: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Flare CSS Editor

Selectors

Properties Values

Page 6: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Flare CSS editor view

h1{

font-size: 24.0pt;font-weight: bold;

}

Text editor view

Page 7: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

<html>

<body>

<h1>Installation</h1>

<body>

</html>

h1 { color: blue; font-family: Verdana; font-weight: bold;}

Installation

Topic (.htm file) StyleSheet (.css file) Generated output

Page 8: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Dozens of types of CSS selectorsCommonly used in Flare projects Less commonly used

Type Example CSS Selector

Type p

Class p.Note

ID p#Intro

pseudo classes a:activea:focusa:hovera:linka:visited

Type Example CSS Selector

Generic .Highlight

Descendant ol ol

Child div.Figure > p

General sibling p ~ span

Adjacent sibling h1.chapterHead + p

Attribute span[class^="SearchHighlight"]a[href$=".pdf"]

Additional pseudo classes

:nth-child:nth-last-child:first-child

Page 9: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

CSS Selector DemoSee http://codepen.io/smartoutput for demo samples

Page 10: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Creating complex selectors in Flare

Page 11: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Example: List Item styles for landing page tile

Link section in tilediv.ModuleLinks

Unordered list in link sectiondiv.ModuleLinks ul

List items in unordered listdiv.ModuleLinks ul li

Page 12: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Example: Background Images in TopNav

Selector to set base styles:ul.navigation > li:nth-child(1)

Selectors to determine styles on mouse hover:ul.navigation > li:nth-child(1):hoverul.navigation > li:hover > a

Selector to determine styles after user clicks the nav item:ul.navigation > li:nth-child(1) > a.selected

Page 13: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

Dev Tools Demo

Page 14: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

TAKE ADVANTAGE OF CERTIFIED TRAININGAs a webinar attendee, receive $100 OFF your next

advanced training course.

MadCap Flare CSS TrainingMay 23-24, 2017 (web-based)

MadCap Flare Single Sourcing TrainingMay 25-26, 2017 (web-based)

For more details, contact [email protected]

Note: Courses subject to change. Availability based on student registration. Certain restrictions apply;cannot be combined with any other offer or promotion. Not valid on courses already purchased.

Page 15: Daniel Ferguson · Class p.Note ID p#Intro pseudo classes a:active a:focus a:hover a:link a:visited Type Example CSS Selector Generic .Highlight Descendant ol ol Child div.Figure

The Premier Technical Communicationand Content Strategy Conference

APRIL 2–5, 2017 | HARD ROCK HOTEL | SAN DIEGO, CALIFORNIA

WWW.MADCAPSOFTWARE.COM/EVENTS/MADWORLD

2 Full Days, 20 Expert Speakers, 40 Informative SessionsPlus: Advanced Training Workshop on Wednesday, April 5