Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size,...

6
Colors & Fonts Building a Website Lesson 7

Transcript of Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size,...

Page 1: Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.

Colors & FontsBuilding a Website Lesson 7

Page 2: Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.

Font <font>The <font> tag specifies the font face, font size, and color of text.

The <font> tag can have any or all of these attributes: face, size, color.

Code Browser<font face=“verdana” size=“5” color=“red”>Look at my color!</font>

Look at my color!

Page 3: Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.

Style <style> Attribute

The style attribute can be used for change the background color or alignment of text.

To change the background color, add the style attribute to the body<body> element.

The alignment of text property can be used for each individual heading (<h1>, <h2>, etc.) or paragraph <p> element.

Page 4: Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.

Background ColorTo change the background color, add the style attribute with background-color property to the body element.

Code Browser<body style=“background-color:black”> <p><font color=“orange”>This is Halloween</font></p></body>

This is Halloween

Page 5: Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.

Text AlignmentText is left-aligned by default.

You can add the text-align property to the style attribute to center the text or right-align the text.

Code Browser<body style=“background-color:yellow”> <p style=“text-align:center”>This is centered text.</p></body><body style=“background-color:red”> <p style=“text-align:right”>This is right-aligned text.</p></body>

This is centered text.

This is right-aligned text.

Page 6: Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.

Exit TicketIn HTML, write the code for your name with the following properties:

Yellow font

Blue Background

Centered Text