HTML Tag Text Basics | HTML5 Element Text Tutorial

Dave Gray
14 Dec 202121:25

Summary

TLDRIn this beginner's HTML tutorial, Dave guides viewers through creating text content on a webpage using headings and paragraphs, emphasizing the importance of header hierarchy for semantic meaning and accessibility. He introduces block and inline elements, demonstrates how to use HTML entities and the 'abbr' element for abbreviations, and highlights the use of comments in code. Dave also shows how to validate HTML code for accuracy and encourages continuous learning and improvement in web development.

Takeaways

  • 🌟 HTML is similar to essays or newspapers, structured with headings and paragraphs.
  • 📝 Headings have a hierarchy, starting with one H1 and followed by subtopics using H2, H3, etc.
  • 🔄 Use Shift+Alt+Down Arrow in Visual Studio Code to duplicate lines of code.
  • 📌 The H1 tag should be used only once per page to represent the main topic.
  • 📝 Paragraphs provide details about subtopics and can be styled with CSS later.
  • 🚫 HTML does not honor multiple spaces added with a space bar due to white space collapsing.
  • 💥 Use line breaks (<br>) to insert a break within a paragraph without starting a new one.
  • 📐 Horizontal rules (<hr>) visually separate content without a closing tag.
  • 🔧 Inline elements like <em> and <strong> do not create a new line and can be formatted with CSS.
  • 🔗 HTML entities are used to represent special characters that have reserved meanings in HTML.
  • 📝 The <abbr> tag with the title attribute provides tooltips for abbreviations, enhancing readability.

Q & A

  • What is the main topic of this HTML tutorial?

    -The main topic of this HTML tutorial is creating text content on a web page, including headings and paragraphs, and understanding the hierarchy of headings.

  • Which web development tools does Dave use in this tutorial?

    -Dave uses the Chrome web browser, Visual Studio Code editor, and the Live Server extension for Visual Studio Code in this tutorial.

  • How does the hierarchy of headings work in HTML?

    -The hierarchy of headings in HTML starts with an H1 tag, which should be used only once per page to represent the main topic. Subtopics are represented by H2 tags, and further subtopics under those can be represented by H3 tags and so on.

  • What is the purpose of using headings in web content?

    -Headings provide semantic meaning to the content, indicating the main topic, subtopics, and their hierarchy. They also help assistive technologies like screen readers to navigate and understand the structure of the web page.

  • How can you visually represent the hierarchy of headings on a web page?

    -Visually, headings are represented with decreasing font size, where H1 is the largest and subsequent headings (H2, H3, etc.) get smaller in size.

  • What is a horizontal rule element in HTML, and how does it visually affect the page?

    -A horizontal rule element in HTML is used to create a line across the page, visually separating content. It does not have a closing tag and is typically used to break up sections of a web page.

  • What is white space collapsing in HTML, and how does it affect adding extra spaces on a web page?

    -White space collapsing is a behavior in HTML where multiple spaces, tabs, or line breaks are treated as a single space. This means that adding extra spaces using the space bar will not be represented identically on the web page.

  • How do line breaks work in HTML paragraphs?

    -Line breaks in HTML paragraphs can be created using the `<br>` (line break) element. Unlike typing extra spaces, `<br>` will create a visible break in the line when rendered on a web page.

  • What is the difference between block-level and inline elements in HTML?

    -Block-level elements, like paragraphs and headings, start on a new line and create space around themselves. Inline elements, like `em` and `strong`, do not create a new line and can appear within other elements without breaking the flow.

  • What are HTML entities, and how are they used in web content?

    -HTML entities are codes used to represent characters that have special meanings in HTML, such as `<`, `>`, or extra spaces. They allow these characters to be displayed as their literal characters rather than being interpreted by the browser.

  • How does the `abbr` element work in HTML, and what is its purpose?

    -The `abbr` element is used for abbreviations or acronyms. It should be used with the `title` attribute, which provides the full text of the abbreviation as a tooltip, enhancing the understanding of the abbreviation for users.

  • What is the purpose of an HTML comment, and how can it be viewed by others?

    -An HTML comment is used to leave notes or reminders within the code that are not visible on the web page itself. However, these comments can be viewed by anyone inspecting the page's source code, so sensitive information should not be included in comments.

Outlines

00:00

🌐 Introduction to HTML Structure and Hierarchy

This paragraph introduces the basics of creating text content on a web page, emphasizing the importance of headings and paragraphs. It explains the hierarchy of headings, starting with a single H1 for the main topic, followed by subtopics using H2, and further细分 using H3. The tutorial demonstrates how to use the Visual Studio Code editor and the Live Server extension to view the web page. It also highlights the semantic meaning of headers and how they help in organizing page content and improving accessibility for screen readers and assistive technologies.

05:00

📝 Understanding White Space and Line Breaks

This section discusses the concept of white space collapsing in HTML, where extra spaces added using the space bar are not honored and do not appear on the web page. It introduces the line break element, which can be used within a paragraph to create visual separation between ideas. The paragraph also covers the use of horizontal rules to visually divide content on a web page and the process of copying and pasting content using keyboard shortcuts. Additionally, it touches on the difference between block-level and inline elements, providing examples of each.

10:02

🔧 Working with Inline Elements and HTML Entities

This paragraph focuses on inline elements, such as the 'em' element for emphasis and the 'strong' element for strong importance. It explains how these elements are used within paragraphs and affect the text's appearance and semantic meaning. The section also introduces HTML entities, which are used to represent special characters that have specific meanings in HTML, like the less than (<) and greater than (>) symbols. The tutorial demonstrates how to use entities for creating visual space and displaying symbols like the copyright (©) and the ampersand (&).

15:03

🏷️ Utilizing Abbreviations, Addresses, and Comments

This segment covers the use of the 'abbr' element for abbreviations and the 'address' element for marking up contact information. It explains how to provide additional information through the 'title' attribute for accessibility purposes. The paragraph also discusses the use of HTML comments as a way to leave notes within the code, highlighting that these comments are visible in the source code but not on the web page itself. The importance of keeping content accessible and meaningful for all users, including those using assistive technologies, is emphasized.

20:04

🔍 Validating HTML and Ensuring Quality

The final paragraph discusses the importance of validating HTML code to ensure its correctness and to identify any potential errors or warnings. It guides the user through the process of using the W3C Markup Validation Service to check the HTML file and provides instructions on how to interpret the validation results. The paragraph concludes with an encouragement to strive for progress in learning HTML and to seek continuous improvement.

Mindmap

Keywords

💡HTML

HTML, or HyperText Markup Language, is the standard markup language used to create web pages. It provides the structure and content of a web page, and is the backbone of the internet. In the video, the creator is teaching beginners how to use HTML to build a basic web page, starting with text content like headings and paragraphs.

💡Web Page Structure

Web page structure refers to the organization and layout of content on a web page, typically using HTML elements to define headings, paragraphs, and other sections. The video emphasizes the importance of a clear hierarchy, starting with a main heading (h1) and subheadings (h2, h3, etc.), which helps both users and search engines understand the page's content.

💡Heading Hierarchy

Heading hierarchy is the ordering of headings (h1, h2, h3, etc.) in a document to represent the structure and importance of different sections. It helps in creating a logical and navigable content layout. In the video, the creator explains that each page should have one main h1 heading, with subtopics represented by h2, and further subtopics under those using h3 and so on.

💡Visual Studio Code

Visual Studio Code is a free, open-source code editor developed by Microsoft. It is highly customizable and supports a wide range of programming languages, making it a popular choice for web development. In the video, the creator uses Visual Studio Code as the editing tool to write and edit HTML code.

💡Live Server Extension

The Live Server extension is an add-on for code editors like Visual Studio Code that allows developers to view their web projects in real-time as they make changes. It simplifies the development process by automatically refreshing the browser view whenever you save your code.

💡Paragraphs

Paragraphs are blocks of text that are used to organize and present information on a web page. They typically consist of multiple sentences that relate to a single topic. In HTML, paragraphs are created using the <p> tag. The video explains how to create paragraphs under headings to add details to the web page's content.

💡Horizontal Rule

A horizontal rule is an HTML element (<hr>) that represents a thematic break or separation between content on a web page. It visually creates a horizontal line across the page, often used to separate different sections or articles. The video shows how to add a horizontal rule to enhance the visual separation of content.

💡Whitespace Collapsing

Whitespace collapsing is a behavior in HTML where multiple spaces, tabs, or line breaks are treated as a single space. This means that adding multiple spaces between elements does not create additional visible space on the web page. The video clarifies that while you can add spaces for readability in the code, they will not translate to the displayed page.

💡Line Breaks

Line breaks in HTML are used to insert a break within a paragraph, causing text to appear on a new line. This is done using the <br> tag. It helps in controlling the layout of text within a paragraph without creating a new block-level element.

💡Block-Level Elements

Block-level elements in HTML are those that create a block of content, starting on a new line and occupying the full width available. They create a visible space around the content and can contain other block or inline elements. Examples include headings, paragraphs, and div elements. The video explains the concept of block-level elements and how they structure the page's layout.

💡Inline Elements

Inline elements in HTML are those that do not create a new line by themselves and only occupy the space necessary to display their content. They can be nested within block-level elements but do not add additional space around the content. Examples include <a> for links, <em> for emphasis, and <strong> for strong importance. The video illustrates the use of inline elements like <em> and <strong> within paragraphs to emphasize text.

Highlights

Introduction to the beginner's HTML tutorial series using Chrome web browser, Visual Studio Code editor, and Live Server extension.

Explanation of creating text content on a webpage, comparing it to essays or newspapers with headings and paragraphs.

Demonstration of using headings (H1, H2, H3) to establish a hierarchy and subtopics within the webpage content.

Discussion on the importance of having only one H1 tag per page for semantic meaning and structure.

Illustration of how to copy and paste HTML elements using keyboard shortcuts for efficiency.

Explanation of the difference between block-level elements (like paragraphs and headings) and inline elements (like the 'em' element for emphasis).

Introduction to HTML entities for special characters and symbols, and their use in web content.

Use of the 'abbr' element for abbreviations and the 'title' attribute for providing additional information.

Inclusion of an address element to denote a specific location, adding semantic meaning to the content.

Explanation of HTML comments, their purpose, and visibility in the source code.

Importance of validating HTML code using W3C's markup validation service to ensure there are no errors or warnings.

The tutorial's approach to teaching HTML emphasizes learning through practical examples and hands-on coding.

Use of Visual Studio Code and its features, such as automatic tag closing and formatting, to aid in web development.

The concept of white space collapsing in HTML and how it affects the representation of spaces on a webpage.

Demonstration of line breaks within a paragraph element to control the visual formatting of text on a webpage.

The role of CSS in future lessons for styling web pages and the separation of content from presentation.

The tutorial's encouragement of incremental learning and the philosophy of 'progress over perfection'.

Transcripts

play00:00

[Music]

play00:04

hello and welcome hi i'm dave

play00:07

this tutorial is part of a beginner's

play00:09

html series i'll be using the chrome web

play00:12

browser the visual studio code editor

play00:14

and the live server extension for visual

play00:16

studio code to view the web page there

play00:19

are links to these tools starter code

play00:21

files and all resources in the

play00:23

description below let's look at the

play00:25

basics of creating text content on a web

play00:28

page

play00:29

now web pages are a lot like essays or

play00:32

even a newspaper where they have

play00:34

headings and usually paragraphs of text

play00:37

or at least a sentence or two of text

play00:39

describing something afterwards so we

play00:41

see our paragraph element here

play00:43

and our h1 heading here much of the text

play00:47

content on a web page will be made up of

play00:49

headings and paragraphs now headings

play00:52

have a hierarchy and that means

play00:55

we'll start out with only one h1 on the

play00:58

page and each page should only have one

play01:00

h1 but after that we can have subtopics

play01:04

so here i'm going to press shift alt and

play01:06

the down arrow again i'm using windows

play01:09

it may be different for you on mac or

play01:10

linux but i just copied a line down so

play01:14

now i have two h1s but i'm going to

play01:16

change this

play01:17

by typing h2 over that h1 and notice how

play01:21

the ending tag immediately changed here

play01:24

in visual studio code as well so that's

play01:26

helpful now this is a sub topic for the

play01:28

page so imagine this being the title of

play01:30

your essay or

play01:32

the big headline in a newspaper and then

play01:35

we have subtopics so for h2 i'm going to

play01:39

type something different let's go with

play01:42

i'm ready to learn

play01:45

html

play01:47

and now we can have a paragraph about

play01:49

that and so we do at least we have a

play01:51

sentence this is my first web page

play01:54

now i'm going to highlight this

play01:56

subheading h2 and the paragraph and once

play01:59

again i'm going to press shift alt and

play02:01

the down arrow

play02:03

and it copies both lines down for me and

play02:06

i'll add an extra blank line here and

play02:08

i'm going to change this second h2

play02:11

into an h3 now we i'll use lowercase

play02:14

there we go

play02:15

now we could have more than one h2 on

play02:17

the page but i wanted to show how you

play02:19

could have a subtopic

play02:21

under our subtopic so we have the title

play02:24

for our essay

play02:26

and then we have an area of discussion

play02:28

that we've added in h2 as the heading

play02:31

for and now under this area of

play02:33

discussion we could have further

play02:35

subtopics and this is how we now have an

play02:37

h3 so now instead of my first web page

play02:41

or i'm ready to learn html let's change

play02:43

this to

play02:45

my daily schedule so this will

play02:48

discuss our schedule for learning html

play02:53

and then we could just say something

play02:54

about i'm going to tell you how or

play02:57

let me

play02:58

tell

play02:59

you how i and i'll just put some dots

play03:02

there for now just we'll expand on that

play03:04

later if we want to but really what i'm

play03:07

showing is this hierarchy and it's also

play03:09

important not just visually let me go

play03:12

ahead and save this by pressing ctrl s

play03:15

or remember you can go to the file menu

play03:16

and choose save

play03:19

visually we see

play03:20

that it's naturally formatted larger on

play03:23

the page with the h1 than it is the h2

play03:26

and then the h3 is even smaller than the

play03:29

h2 but we can change all of that with

play03:32

css in the future css will really style

play03:36

how our web page looks

play03:38

but what is important is we can quickly

play03:41

visually tell the headers apart right

play03:43

now

play03:44

and when a screen reader or other

play03:46

assistive technology looks at our code

play03:50

then it can navigate the code through

play03:53

the headers of what is important here

play03:55

the header hierarchy and that's why it's

play03:58

so important to organize your page the

play04:01

headers actually give semantic meaning

play04:03

saying

play04:04

this is the main topic this is a

play04:07

subtopic under the main topic and this

play04:09

is a subtopic under

play04:12

the higher

play04:13

subtopic in the hierarchy so headers do

play04:16

have semantic importance and that means

play04:18

giving meaning to our content and of

play04:21

course then our paragraphs can just have

play04:24

whatever details we want to add about

play04:26

those subtopics as well now even though

play04:28

we've created a little separation in our

play04:30

code when we look at our page we just

play04:33

see line space line space and we don't

play04:35

have a good visual separation i'm going

play04:37

to add an element that doesn't really

play04:40

provide any semantic meaning but

play04:42

visually it helps us on the page and

play04:44

that is a horizontal rule element and

play04:47

it's just added like this there is no

play04:49

closing tag for the horizontal rule and

play04:52

then i'm going to add another one after

play04:55

our final subtopic discussion here so we

play04:57

can add something else underneath that

play05:00

and so now let's save and look what the

play05:02

horizontal rule adds to the page

play05:04

now we have lines going across the page

play05:07

and those are called horizontal rules so

play05:09

we have our main heading and now we have

play05:11

our subtopic and i left the h3 in here

play05:14

because it's a subtopic

play05:17

of this topic

play05:18

so now we can go ahead and i'm going to

play05:21

highlight the h2 and the h3 ctrl c to

play05:25

copy

play05:26

come down further on the page and paste

play05:30

and i'll save just so we can see what

play05:31

happens now we have two different

play05:34

subtopic sections and we still have our

play05:36

top hello world so you could picture

play05:39

this more like an essay page and of

play05:41

course these could be

play05:43

paragraphs that have more text or you

play05:46

could picture this more like a newspaper

play05:48

and then we would have an article here

play05:50

and an article here

play05:52

in our heading at the top this is also a

play05:55

good time to discuss white space so if i

play05:58

just press the space bar

play06:00

and add all these extra spaces to the

play06:02

page

play06:04

if i say visual studio code is already

play06:06

going to probably reformat this but what

play06:09

is important to know when i save you'll

play06:11

see yes it changed and it just went back

play06:13

and only left one space

play06:15

is

play06:16

web pages or html

play06:18

do not honor all those spaces you might

play06:20

add with a space bar it's called white

play06:22

space collapsing and so we can space

play06:25

many lines

play06:27

but it won't really be represented on

play06:29

the page that is not how we add extra

play06:32

space in html so again recognize white

play06:35

space collapsing that it will not last

play06:37

now something we can do is what's called

play06:40

a line break and that can be inserted

play06:42

inside a paragraph element so now i'll

play06:45

put let me tell you how and then i'm

play06:48

going to return remember we don't have

play06:52

to have the opening and closing tags on

play06:54

the same line for an element we can nest

play06:56

other elements inside of an element so

play06:59

i'm going to put a break and that stands

play07:02

for line break

play07:03

and then i'll put three dots and i'll

play07:05

say let me tell you how

play07:07

i learn more about web dev

play07:12

and a period that looks good and now we

play07:14

can put another break and i'll just put

play07:16

three more dots

play07:17

and say i plan

play07:21

out my schedule

play07:23

and one more line break

play07:26

the three dots of course are not

play07:27

required it's just what i'm adding here

play07:29

and then i'll say i use

play07:31

resources from

play07:33

mdn which previously we discussed and

play07:36

when i showed the definition of html we

play07:38

were looking at the mozilla developer

play07:40

network and that's what mdn is

play07:43

so now if we save this file you can see

play07:46

we've got line breaks

play07:48

and we're showing each of these details

play07:50

on separate lines okay let's scroll down

play07:53

and change some of our second topic now

play07:56

so instead of i'm ready to learn html

play07:59

let's change our second subtopic to

play08:02

i am let me capitalize that i am also

play08:07

planning a

play08:08

vacation

play08:10

and now we can put some details about

play08:12

that vacation in the paragraph

play08:14

underneath this subtopic

play08:16

and i'll say

play08:18

i've been working hard

play08:21

and really

play08:23

need a

play08:24

getaway period

play08:26

and let's see if we want to add anything

play08:28

underneath that yep let's add one more

play08:30

sentence and what i'm going to do once

play08:32

again is shift alt and the down arrow

play08:35

and visual studio code will copy that

play08:37

line down so

play08:38

now we can just change the sentence here

play08:40

and i'll say

play08:42

i live in kansas

play08:44

so i want to

play08:46

visit

play08:47

a beach

play08:48

kansas is nowhere near the ocean so that

play08:50

sounds pretty good so let's save that

play08:54

and now we can see our subtopic here

play08:56

changed and we have a couple of

play08:58

sentences

play08:59

about planning the vacation now let's

play09:01

change the my daily schedule subtopic at

play09:05

the h3 to

play09:07

places

play09:08

i'd like to

play09:10

visit

play09:11

and i guess i could capitalize that l on

play09:14

like there we go places i'd like to

play09:15

visit

play09:16

and now i'll highlight that paragraph

play09:18

and say

play09:20

i've heard

play09:21

good things

play09:23

about the

play09:25

caribbean

play09:27

sounds like they have warm water and

play09:30

fun islands to visit okay so now we've

play09:32

got some extra details here

play09:35

and we can have more than one sub topic

play09:38

here so let's go ahead and do that again

play09:40

shift alt and the down arrow to copy

play09:42

that

play09:43

and places

play09:45

i want to avoid could be our next one so

play09:48

places i want to avoid

play09:50

and here we can put

play09:54

anywhere cold

play09:56

no

play09:58

way with an exclamation mark okay so now

play10:02

we've got some extra detail here in our

play10:04

second area and this will allow me to go

play10:08

ahead and show you the difference

play10:09

between block level elements and inline

play10:12

elements what we've been working with

play10:14

here are block level elements notice

play10:16

with every paragraph and every heading

play10:18

they start on a new line that is a block

play10:22

level element it creates space around it

play10:24

which of course can be formatted in the

play10:26

future with css

play10:28

but it does not allow you to put another

play10:31

paragraph inside of a header or a

play10:34

paragraph without creating that new line

play10:37

that space so there will be

play10:39

a return essentially in your content

play10:42

when you're using a block level element

play10:44

but when you use an inline element that

play10:46

doesn't happen so let's look at a couple

play10:49

of these first of all

play10:51

we can say

play10:52

i've been working really hard and

play10:55

i've been working hard and really need a

play10:57

getaway let's emphasize that really need

play10:59

a getaway and one in line element that

play11:02

we can do that with is em and that

play11:05

stands for emphasis that provides some

play11:08

semantic meaning once again so now a

play11:11

screen reader or other assistive

play11:14

technology or are just our browser

play11:16

overall knows we're emphasizing this

play11:18

really need a get away so let's save and

play11:21

notice

play11:22

really need a getaway is italicized now

play11:25

we're not using it for the italicized

play11:28

text again the formatting will come

play11:29

later with css but that is just the

play11:32

natural behavior of using the emphasis

play11:35

element as we wrap our text but it

play11:38

provides that meaning now what if we

play11:41

really want to emphasize that text it

play11:43

has a strong meaning to us like are no

play11:46

way here we don't want to go anywhere

play11:48

cold well there is a

play11:50

strong element we can use for that

play11:54

and here let me grab the ending tag and

play11:56

put it at the end of our no way

play11:59

and now i'll save and notice it got just

play12:02

a little bit bigger and bolder here as

play12:04

far as the natural formatting of the

play12:06

strong element but again this is an

play12:08

inline element it's inside the paragraph

play12:11

it did not create a

play12:13

break in the line it did not create any

play12:16

extra space around it so these are

play12:18

inline level elements

play12:20

and the other elements such as the

play12:22

header and the paragraph we've been

play12:24

working with are block level elements

play12:27

another type of content we can add to

play12:29

our page are html entities so they are

play12:33

things that are not really the normal

play12:36

text we would type out what for example

play12:38

if we wanted to

play12:40

show a less than or a greater than

play12:43

symbol on our page right now html

play12:46

interprets those as we're starting or

play12:47

ending a tag so we can't just easily put

play12:50

one of those on the page likewise there

play12:52

are some other symbols or remember when

play12:55

i talked about white space collapsing if

play12:57

we need a little bit of extra space

play12:59

there's an html entity for that so i

play13:01

want to indent these three lines with a

play13:03

little bit of space

play13:05

and i can use the html entity i still

play13:08

need the closing there here we go

play13:10

and ampersand is usually what starts out

play13:13

an html entity and now i'll type

play13:15

nbsp and a semicolon

play13:18

notice visual studio code recognizes

play13:20

that right away

play13:22

and if i save

play13:23

i have spaced this line over just a

play13:26

little bit

play13:27

now i can add more than one of those if

play13:29

i want so i'm going to copy that and i'm

play13:31

going to add two more

play13:34

and now save and our line is over even a

play13:37

little further

play13:38

so i will go ahead and select all three

play13:40

of these

play13:41

and i'm going to paste them right after

play13:44

the line break on each line

play13:46

and save and now we have indented with

play13:49

some extra space

play13:51

all three of these lines with these html

play13:54

entities that create space but as i

play13:56

mentioned there are other html entities

play13:59

as well so let's scroll down here to the

play14:01

bottom of our page

play14:02

and after this last topic

play14:05

let's add another hr

play14:07

and now we'll type

play14:09

and

play14:10

lt

play14:12

and a semicolon and that stands for less

play14:15

than so if we save now look we have a

play14:19

less than symbol underneath the final

play14:21

horizontal rule here at the bottom of

play14:23

the page

play14:24

i'm going to go ahead and copy that

play14:27

and paste

play14:29

two more

play14:30

and then i'm going to add

play14:32

ampersand

play14:34

copy with a semicolon and that will be

play14:36

the copyright symbol then i'll just put

play14:38

my name you can put yours and then i'm

play14:41

going to add ampersand gt for greater

play14:43

than in a semicolon and once again i'll

play14:46

copy that

play14:47

and paste

play14:49

two more now if we save

play14:52

you can see we've got our three less

play14:54

than symbols we've got a copyright

play14:56

symbol

play14:57

then

play14:58

your name or my name and then

play15:01

three greater than symbols and we're

play15:03

using html entities to create those i'll

play15:06

provide a link to a list of html entity

play15:10

codes in the resources for this tutorial

play15:12

you may have noticed we've got a couple

play15:13

of abbreviations on our page we have the

play15:17

abbreviation for kansas which is ks and

play15:19

we also have the acronym or abbreviation

play15:23

for the mozilla developer network here

play15:25

on our page so let's go ahead and add

play15:28

another inline level element

play15:31

and that can help us with our

play15:33

abbreviations

play15:34

and that is abb

play15:36

r but it doesn't really do it by itself

play15:40

i'm going to go ahead and select mdn cut

play15:42

it and paste it here in the middle of

play15:44

the element

play15:45

and this won't really provide anything

play15:47

we also need to add the attribute title

play15:51

here i can put the full

play15:54

text mozilla

play15:56

developer network

play15:58

and save and now when we look at our

play16:00

page it has some dots underneath mdn if

play16:03

we mouse over

play16:05

we get a tool tip that says mozilla

play16:07

developer network now it's important to

play16:09

realize this tool tip will not really be

play16:13

available to screen reader and assistive

play16:15

technology so

play16:17

we don't want anything super important

play16:20

for the understanding of the meaning of

play16:21

the page to be in there so if we are

play16:24

using abbreviation it's a nice thing to

play16:27

have but it is really not accessible to

play16:30

all assistive technologies so

play16:33

it's it you can't have anything in there

play16:35

that the page really depends on because

play16:38

some of the people accessing the page

play16:41

may not be able to read or see the

play16:43

information that you provide here inside

play16:45

the title attribute of the abbreviation

play16:48

element let's go ahead and add that

play16:50

abbreviation element for kansas as well

play16:53

so abbr and then title

play16:56

and i'll spell the state name kansas

play17:00

and then i can go ahead and double click

play17:02

on kansas control x to cut and i'm going

play17:06

to paste it with ctrl v right inside the

play17:08

element

play17:09

save and now

play17:11

dots are under the ks here on the page

play17:13

and if i mouse over we get a tool tip

play17:15

that says kansas let's put another

play17:17

paragraph under places i'd like to visit

play17:20

and i'll put

play17:21

i can just type p and press tab as well

play17:23

there we go and now i'll type

play17:26

i've heard

play17:28

good things

play17:29

about

play17:31

going here with a colon

play17:34

and now i'm going to add

play17:36

an address element

play17:38

and we can put a location

play17:40

inside of this address element and it

play17:42

tells the browser that this is an

play17:44

address or a specific location so i'm

play17:48

just going to paste this in because you

play17:50

don't need to see me type all of this

play17:52

and i might easily have a typo here this

play17:54

is margaritaville island in cancun it

play17:57

sounds like a great place for a vacation

play18:00

notice we've got a line break element

play18:02

after each line except the last line and

play18:05

if we save this and look at the page you

play18:07

can see how the browser handles this

play18:10

it is

play18:11

just three lines of text it is all

play18:13

italicized by default

play18:16

and the browser knows that this is an

play18:18

address and once again so would

play18:20

assistive technology so an address

play18:22

element

play18:23

does provide

play18:24

some semantic meaning as well to the

play18:27

content within it now before we finish

play18:29

this lesson about content there's one

play18:32

other thing we can add to our code now

play18:34

we won't see it on the page but it is

play18:36

important to us

play18:38

and this is an html comment

play18:41

and so now you can see visual studio

play18:43

code colored this differently at least

play18:45

with the theme that i'm using and we can

play18:47

leave a note for ourselves inside of our

play18:49

code now notice this will not be on the

play18:52

page but i will show you how the public

play18:54

can see it so you don't want to put

play18:56

anything in here that you don't expect

play18:59

the public to be able to read

play19:01

i'll put a to-do which is a common use

play19:03

and i'll just put add

play19:05

more places so it's a reminder to me to

play19:07

add more places to the list of places i

play19:09

want to avoid we save that and it

play19:12

doesn't show on the page it's just a

play19:13

reminder in the code or a note to

play19:16

yourself inside of the code but i will

play19:18

show you how the public can see this if

play19:21

we right click

play19:22

and choose inspect

play19:24

that works or you can also press ctrl u

play19:28

either way will show your source code

play19:31

now notice we've got a comment in here

play19:33

that says add more places it's not

play19:36

visible on the web page itself but it is

play19:38

visible in the source code again you can

play19:40

press ctrl u

play19:42

to view this

play19:44

now notice live server also injected a

play19:46

comment here and it injected some

play19:49

javascript so when we look at the

play19:50

overall source code of what is live

play19:53

we're seeing more than we even had but

play19:55

this is a comment once again that is not

play19:57

seen on the page and live server is

play19:59

using a script element that we do not

play20:02

see on the page either and that can

play20:04

contain javascript for example so

play20:06

just to let you know if you leave a note

play20:08

for yourself

play20:10

it can be viewed by others and finally

play20:12

now that we've added all of this html

play20:14

content to our page we once again should

play20:18

go to the validator markup validation

play20:21

service from w3c to check our file to

play20:25

see if it is valid html or if we have

play20:27

any mistakes choose validate by file

play20:29

upload

play20:30

and then click choose file

play20:33

i'm going to have to probably go to a

play20:35

different folder from the one that i

play20:37

checked last so i'll go to html course

play20:40

lesson three which is the file we are

play20:42

working with choose my index.html and

play20:45

open that here with the validator now it

play20:47

has the index.html file uploaded and we

play20:50

can click check

play20:52

and we'll see if we have valid html so

play20:55

this is valid it's green document

play20:57

checking completed no errors or warnings

play20:59

to show if you have errors or warnings

play21:01

it should point out exactly where that

play21:03

error is and you can fix that in your

play21:05

html remember to keep striving for

play21:08

progress over perfection and a little

play21:10

progress every day will go a very long

play21:12

way please give this video a like if

play21:15

it's helped you and thank you for

play21:17

watching and subscribing you're helping

play21:18

my channel grow have a great day and

play21:21

let's write more code together very soon

Rate This

5.0 / 5 (0 votes)

Связанные теги
WebDevelopmentHTMLTutorialContentStructureHeadingHierarchyParagraphsCSSStylingVisualStudioCodeLiveServerWebAccessibilityHTMLEntitiesWebPageDesign
Вам нужно краткое изложение на английском?