+ All Categories
Home > Documents > IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers...

IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers...

Date post: 02-Aug-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
25
1 www.ieclass.com - Copyright © IE Class, Inc. IE Class Unit 3 – Lesson 1 HTML Tags & Structure www.ieclass.com - Copyright © IE Class, Inc. Notice: The IE Class Slide Presentations are for private classroom use only. They may not be modified, redistributed or posted on any website . They may only be used with a valid current account with IE Class, Inc.
Transcript
Page 1: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

1

www.ieclass.com - Copyright © IE Class, Inc.

IE ClassUnit 3 – Lesson 1

HTML Tags & Structure

www.ieclass.com - Copyright © IE Class, Inc.

Notice: The IE Class Slide Presentationsare for private classroom use only. Theymay not be modified, redistributed orposted on any website. They may onlybe used with a valid current accountwith IE Class, Inc.

Page 2: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

2

www.ieclass.com - Copyright © IE Class, Inc.

What is HTML• Hyper Text Markup Language

– HTML documents are documents that contain formatted, or marked up, text.

– HTML is NOT a programming language, it just a formatting language defining how content should be displayed.

– The formatting instructions in HTML are known as tags.

www.ieclass.com - Copyright © IE Class, Inc.

What is HTML• Why HTML 5?

– HTML 5 is the latest's version of the HTML language.

• Designed to standardize development of web content across multiple devices.

• Designed to look the same regardless of device.

• HTML 5 compatible devices expect certain formatting guidelines to be followed:

Page 3: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

3

www.ieclass.com - Copyright © IE Class, Inc.

What is HTML• HTML Formatting Guidelines

– Should include the DOCTYPE declaration at the top of the page

– Must include a root element <html> ... </html>

– All tags should be in lower case– All attributes must be quoted– All styles incorporated through the use of

CSS

www.ieclass.com - Copyright © IE Class, Inc.

What is CSS• Cascading Style Sheets

– HTML is used to define the structure of a web page.

– CSS defines how the page looks.– For Example:

• HTML will identify a block of text as a paragraph.

• CSS will define what the font of the text is, the color, placement, background color, etc.

Page 4: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

4

www.ieclass.com - Copyright © IE Class, Inc.

Web Page Structure• A web page structure is made up of

various elements.– An element is any part that makes up the

web page:• Images• Paragraphs• Headings• Links• Etc.

www.ieclass.com - Copyright © IE Class, Inc.

Web Page Structure

Page 5: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

5

www.ieclass.com - Copyright © IE Class, Inc.

Web Page Structure• Page Elements

– Root Element• This is the web page itself. HTML is designed

for elements to contain other elements so all other parts of the page will be placed on the root element.

– Head & Body Elements• The head and body are the two main parts of

the root element.– Generally anything that works behind the scenes go

in the head element.– Anything you see in your browser window will go in

the body element.– The head and body elements should be included on

all web pages.

www.ieclass.com - Copyright © IE Class, Inc.

Starting Tags

Page 6: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

6

www.ieclass.com - Copyright © IE Class, Inc.

Content Container Elements• header

– Defines the subject of information being presented.

– Generally placed at the top of the page, but can also be used to define the top of other elements on the page.

• nav– Defines content as the pages navigation.

www.ieclass.com - Copyright © IE Class, Inc.

Content Container Elements• section

– Used to group content together.– Can be used to group other elements.– Can be used inside other elements to

group content.– Example

• Might be used to create newspaper style columns.

Page 7: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

7

www.ieclass.com - Copyright © IE Class, Inc.

Content Container Elements• article

– Defines the primary content on the page.• aside

– Defines secondary content, or content that does not directly relate to the topic of the page.

• Advertisements• Illustrations

www.ieclass.com - Copyright © IE Class, Inc.

Content Container Elements• footer

– defines footer information such as copyrights, or anything that should appear at the bottom of the page or element.

• div– is a generic container element. Might be

used to put content that would not fit in any of the other named containers.

Page 8: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

8

www.ieclass.com - Copyright © IE Class, Inc.

Formatting Tags• Formatting tags

– HTML tags that can be used to apply styles to content.

www.ieclass.com - Copyright © IE Class, Inc.

Formatting Tags<h1> ~ </h1> Formats text a top, or first,

level heading.<p> ~ </p> Formats text as a

paragraph.<strong> ~ </strong> Bolds the text it encloses.

<em> ~ </em> Italicizes the text it encloses.

<mark> ~ </mark> Highlights enclosed text.

Page 9: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

9

www.ieclass.com - Copyright © IE Class, Inc.

Other Important Tags<br> Forces a line break.

<wbr>Tells the browser that if a line break is need, it should be here, otherwise the break is ignored.

<hr>Horizontal Rule tag. Draws a horizontal line

www.ieclass.com - Copyright © IE Class, Inc.

Basic Tags• Line Breaks <br >

Line 1 <br>Line 2 <br>Line 3 <br>Line 4 <br>

Line 1 Line 2 Line 3Line 4

The line break does not use a separate closing tag because it does not surround any text. It only indicates where a line break should be placed in the flow.

Page 10: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

10

www.ieclass.com - Copyright © IE Class, Inc.

Structuring your tags• HTML tags encapsulate (surround) the

text that they are formatting.

• If more than one tag is formatting the text, then the closing tags should be written in reverse order from how they were opened.

<strong><<strong><emem>Text >Text to Formatto Format</</emem></strong>></strong>

www.ieclass.com - Copyright © IE Class, Inc.

Block & Inline Elements• Block Elements

– Groups content together in an isolated box. Other content either flows above or below the element.

Page 11: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

11

www.ieclass.com - Copyright © IE Class, Inc.

Block & Inline Elements• Inline Elements

– Applies a style around content without having any effect on the layout of the other content on the page.

www.ieclass.com - Copyright © IE Class, Inc.

Tag Attributes• An attribute is a feature that you

can add to a tag that will allow you to modify how the tag behaves.– Tag Attributes

• Simple adjustments that can be made to an element.

– Style Attributes• Defines the elements styles, how its content

appears.

Page 12: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

12

www.ieclass.com - Copyright © IE Class, Inc.

Setting Style Attributes• Added to the opening tag only.• Consists of a property and value.• Written in the following format:

• Additional style property can be added by separating style with semi-colons.

<tag style=“property: value” >

<tag style=“property: value; property: value” >

www.ieclass.com - Copyright © IE Class, Inc.

Colors• We will start out by setting the

background color and text color of elements.– Colors are defined in hexadecimal, or

hex, format.– Defined by declaring the values of Red

Blue and Green.

Page 13: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

13

www.ieclass.com - Copyright © IE Class, Inc.

Colors• Hexadecimal is written by defining how

much red, green, and blue should be included.

• Color values range from 0 – f– 0 meaning lowest level, or none.– f meaning highest level.

0 1 2 3 4 5 6 7 8 9 a b c d e f

www.ieclass.com - Copyright © IE Class, Inc.

Colors• Hexadecimal format with two red values,

two blue values, and two green values:

#rrggbb

#ff0000 #00ff00 #0000ff

Page 14: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

14

www.ieclass.com - Copyright © IE Class, Inc.

Setting Background Color• Uses the Style Attribute

– Property• background-color:

– Uses any hex color value.

<body style=“background-color: #ff0000”>

www.ieclass.com - Copyright © IE Class, Inc.

Setting Text Color• Uses the Style Attribute

– Property• color:

– Uses any hex color value.

<body style=“color: #ffffff”>

Page 15: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

15

www.ieclass.com - Copyright © IE Class, Inc.

Special Characters• Web browsers will only recognize one

space following a word or character, ay additional spaces will be ignored.

• For example, if you were to type a word and press the space bar five times, only the first space would be recognized by the browser.

– To add additional spaces to a web page, HTML includes a set of code called Special Characters.

www.ieclass.com - Copyright © IE Class, Inc.

Special Characters• HTML tags are created between the

< and > brackets– Special characters are created between the &

and ; characters.

– Special characters are the characters and symbols that are not on your keyboard, or that the browser would normally interpret as something else, or ignore.

Page 16: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

16

www.ieclass.com - Copyright © IE Class, Inc.

Special Characters&nbsp; Space

&lt; <&gt; >

&copy; ©&amp; &&quot; “

www.ieclass.com - Copyright © IE Class, Inc.

Guided Practice

<!DOCTYPE html><html>

</html>

Open a new document in your text editor. Add the DOCTYPE declaration tag and opening and closing html tags shown below. Add some space between them as written here.

Page 17: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

17

www.ieclass.com - Copyright © IE Class, Inc.

Next add the head and body sections to the document. Notice the different color tags. The code in black should already be typed. The new code will always be in maroon.

<html><head>

</head><body>

</body></html>

www.ieclass.com - Copyright © IE Class, Inc.

Next add the tags to your document. The title is always written in the head section of your document.

<html><head><meta charset=“utf-8”><title>Lesson 1</title></head><body>

</body></html>

Page 18: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

18

www.ieclass.com - Copyright © IE Class, Inc.

Save the file as lesson1.htm to your Unit 3 directory.Do not close your text editor, but switch to your web browser and open the lesson1.htm file you just saved.The document should be blank, but the title should be shown in the tab or title bar at the top.

www.ieclass.com - Copyright © IE Class, Inc.

Switch back to your text editor and move down to the body region. Add the header container element shown here with the text inside it.

<body><header>

Quotations</header>

</body></html>

Page 19: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

19

www.ieclass.com - Copyright © IE Class, Inc.

The content in the heading will be formatted as a level 1 heading. The h1 tag will apply formatting to the text.

<body><header>

<h1>Quotations</h1></header>

</body></html>

www.ieclass.com - Copyright © IE Class, Inc.

Resave your document and refresh your browser. You should now see the heading you just created.

Page 20: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

20

www.ieclass.com - Copyright © IE Class, Inc.

Below the heading, add the article container element shown here.

<body><header><h1>Quotations</h1></header><article>

</article></body>

www.ieclass.com - Copyright © IE Class, Inc.

Next add the paragraph content to the article element.

<body><header><h1>Quotations</h1></header><article><p>Nothing great was ever achieved without enthusiasm. Ralph Waldo Emerson</p><p>Knowing yourself is the beginning of all wisdom. Aristotle</p></article></body>

Page 21: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

21

www.ieclass.com - Copyright © IE Class, Inc.

Resave your document and refresh your browser. You should now see the two quotes on your page. Notice the size difference in the level 1 heading and the paragraph text.

www.ieclass.com - Copyright © IE Class, Inc.

Page Structure• The page structure

you just created matches the page structure shown here.

• The labs will illustrate page structure in this way.– The page “blue print”

header

article

<body>

</body>

Page 22: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

22

www.ieclass.com - Copyright © IE Class, Inc.

Adding Style• After a new house has been built,

generally it is painted, given fancy tiles, fixtures, window treatments, and everything to make it look nice.

• The same is true with web pages.– After building the web page, we can then

add its “interior design”• Background colors• text colors, etc

www.ieclass.com - Copyright © IE Class, Inc.

Adding Style• We will apply styles using style

attributes.– Style attributes are known as inline style

sheets.– Inline style sheets follow the structure

shown here.

<tag style=“property: value” >

Page 23: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

23

www.ieclass.com - Copyright © IE Class, Inc.

Next add the inline style sheet to top opening body tag.

<body style=“background-color: #ffffcc”><header><h1>Quotations</h1></header><article>

www.ieclass.com - Copyright © IE Class, Inc.

Resave your document and refresh your browser. The background should now be a light yellow.

Page 24: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

24

www.ieclass.com - Copyright © IE Class, Inc.

Next add the inline style to the opening header tag.

<body style=“background-color: #ffffcc”><header style=“background-color: #5ccccc”><h1>Quotations</h1></header><article>

www.ieclass.com - Copyright © IE Class, Inc.

Resave your document and refresh your browser. The header element should now be defined by a light blue background color.

Page 25: IE Class · 2021. 7. 15. · 15 - Copyright © IE Class, Inc. Special Characters • Web browsers will only recognize one space following a word or character, ay additional spaces

25

www.ieclass.com - Copyright © IE Class, Inc.

Next add the style to the opening article tag.

<body style=“background-color: #ffffcc”><header style=“background-color: #5ccccc”><h1>Quotations</h1></header><article style=“color: #006363 ”><p>Nothing great was ever achieved without enthusiasm. Ralph Waldo Emerson</p><p>Knowing yourself is the beginning of all wisdom. Aristotle</p></article></body>

www.ieclass.com - Copyright © IE Class, Inc.

Resave your document and refresh your browser. The text color of the content in the article element should now be blue.


Recommended