2022.2

Table Of Contents
p {
color: MyColor;
}
CMYK colors
Youmayusethecustomcmyk()CSSfunctiontoassignaCMYKcolortoanyelement,oraseriesofele-
ments.ThefollowingexampleassignsasteelbluecolorasabackgroundforallH1elements:
h1 {
background-color: cmyk(33%, 17%, 0%, 20%);
}
Coloring text
Insteadofusingastylesheet(seeabove),youcancolortextlocally:
1. SelecttextoranHTMLelementthatcontainstext(see"Selectinganelement"onpage570).
2. Onthemenu,selectFormat > Color,orclicktheblacktriangleontheText colortoolbarbutton.
3. Selectoneofthecolorsinthelist,orclickOthertosetallaspectsofthetextstyle,includingtext
colorand/orbackgroundcolor.
Coloring backgrounds and borders
Insteadofusingastylesheet(seeabove),youcancolorabackgroundorborderlocally.Thisishow:
1. SelectanHTMLelement(see"Selectinganelement"onpage570).
2. OntheFormatmenu,clicktheelement.Foradivelement,clickBox.TheFormattingdialog
opensup.
3. ClicktheBorderorBackgroundtab.
4. ClickthedownwardpointingarrownexttoColortoselectacolorfromthelistofpredefinedcol-
ors(see"Definingcolors,spotcolorsandtints"onpage699).
Alternatively,clickthesmallrectangletotherightofthecolorlisttoopentheColorPickerdialog.
Inthisdialogyoucanselectacolorfromthecolorwheel.Youcanalsochoosethecolormode:
RGBorCMYK.Foranexplanationofthesetwomodes,see"Definingcolors,spotcolorsand
tints"onpage699;foranexplanationoftheotheroptionsinthisdialog,see"ColorPicker"on
page878.
YoucouldalsotypeanameorvalueintheColorfielddirectly.Itmustbeavalidcolorname(see
colornamesonw3schools),ahexadecimalcolorcode(seew3school'scolorpicker),RGBcolor
value,forexamplergb(216,255,170)orCMYKcolorvalue,forexamplecmyk(15%, 0%,
Page 702