2022.2

Table Of Contents
l
CSSrulesforHTMLelements,suchasparagraphs,areautomaticallyappliedtoallelementswith
thecorrespondingHTMLtag.
l
TomakeaCSSruleforacertainclassorIDworkforanelementinyourdocument,youhaveto
addtheclassorIDtothatHTMLelement(asdescribedbelow).
Note: Classesmaybereusedthroughoutonesection,butaspecificIDshouldnotbeused
morethanonceineachsection.CSSlayoutrulesforanelementwithacertainIDonly
applytothefirstelementwiththatIDineachsection.Ifyouhavetwosectionsinsideofa
Printcontext,thenyoucanhavethesameIDontwosections;theywillbothbeaffectedby
theCSSrulesfortheelementwiththatID.
l
Stylesheetsonlyapplytosectionsinwhichtheyareincluded;see"Applyingastylesheettoa
section"below.
Adding a class or ID to an HTML element
1. Selecttheelement(see"Selectinganelement"onpage570).
2. OntheAttributespane,typetheIDand/orclass.TypetheIDwithoutthepreceding#andclass
nameswithoutadot.
Note:Elementscanhavemultipleclasses.Separatetheclassnameswithaspace(eg.
“redsmall”).
Alternatively,afterselectinganelement,youcanclicktheSourcetabatthebottomoftheworkspace.
Theselectedelementwillbehighlightedinthesource.Addtheclassorclassesand/ortheIDtothe
openingtagoftheHTMLelement,forexample:<p class=”intro”>.
Tip:
WouldyouliketoknowwhichelementshaveacertainclassorID?
UsetheTextFilterboxatthetopoftheResourcespane.Itallowstolookfortextinthesourceof
anytext-basedfiles,includingsections,masterpages,andsnippets.
Applyingastylesheettoasection
Inorderforastylesheettobeappliedtoaspecificsection,itneedstobeincludedinthatsection.
Therearetwowaystodothis.
Drag & drop a style sheet
Page 678