Cours2 HTML
Cours2 HTML
Think of a document that you would create in a word processor like Microsoft Word or Google
Docs. They usually consist of more than one style. They use different font sizes to indicate
different section of the text, like headers, main content, footers, table of contents, captions, and
so on.
Whereas a human can simply look at a document and understand the difference between a
heading and a paragraph, computers have no such intuition. In order to render correctly a web
page, it must be explicitly told what each piece of content is.
So how exactly do we tell the browser to display a content? This is where Hyper Text Markup
Langauge (or HTML for short) comes in handy.
HTML is the language in which most websites are written. It is used to create pages and make
them functional.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
<!--Everything-->
</html>
The body Tag:
The body element appears after the head element in the page. It should contain all the content of
your web page: text, images, and so on.
All web pages have 1 single body element, in order to understand the tags inside the body, we
will divide them into:
Headings
Text Formatting and Line Breaking Tags
Paragraphs
Images
Audio and Video
Links
Lists
Tables
Buttons
Forms and Inputs
</head>
The head element contains information about the web page. You can put many elements inside
of it such as:
Title => Sets the title of the page
Link => links elements to html, such as the page icon, CSS files...Etc.
Other tags we will see later in the course
Here’s an example down below,” rel” and “href” are called tag attributes, we will get back to them
later in the course.
For now, to set the icon, you need to set rel to “icon” and href to the link to your image.**
Heading tags:
The HTML standard has five additional text heading elements, appropriately defined from < h1
> to < h6 >. They are considered as Paired Tags (We have to close them )
<h1>This is a h1 Heading</h1>
This is a h1 Heading
<h2>This is a h2 Heading</h2>
This is a h2 Heading
<h3>This is a h3 Heading</h3>
This is a h3 Heading
<h4>This is a h4 Heading</h4>
This is a h4 Heading
<h5>This is a h5 Heading</h5>
This is a h5 Heading
<h6>This is a h6 Heading</h6>
This is a h6 Heading
Paired tag:
This is a <b>bold</b> tag test
Note: HTML doesn’t read spaces, you need to use <br> to jump a line
Paragraph tag:
The < p > Tag defines a paragraph in HTML.
the browser breaks a line without the need of the < br> tag.
Paragraphs are automatically separated by a line break.
It's like when you write a paragraph in a word document, paragraphs need to be separated from
each other to give them sense.
Here’s an example :
My first paragraph
My second paragraph
Html attribute:
HTML attributes provide additional information about a HTML element. Attributes can be
considered as properties of the element. An element may have a single attribute, many attributes,
or no attributes at all.
Attributes are placed in the opening tag, with a space after the element declaration (or another
attribute, if there are multiple)
Hello, World!
Linked page:
One of the most important aspects of the World Wide Web is the ability to link to other parts of the
web.
Without a way to redirect our HTML page to other web addresses, there really wouldn’t be a
“web” at all!
We can connect a HTML page to other web pages by creating a hyperlink using the anchor tag.
<audio controls>
</audio>
HTML lists :
Lists are used to group together related pieces of information so they are clearly associated with
each other and easy to read. In modern web development, lists are workhorse elements,
frequently used for navigation as well as general content.
Lists are good from a structural point of view as they help create a well-structured, more
accessible, easy-to-maintain document. They are also useful because they provide specialized
elements to which you can attach CSS styles. Finally, semantically correct lists help visitors read
your web site, and they simplify maintenance when your pages need to be updated.
Ordered list
Unordered list
Description list
Div tag:
<div> is certainly one of the most useful tags in HTML.
The <div>, a block-level element,like a component, or a bag. It can contain many HTML
elements in order to apply a modification on them as a whole section.
<div> helps in organizing your code as well as in being creative using CSS. We will see how a
does that later in the course.
<div>
</div>
<div>
<h1>This is the second division</h1>
</div>
Table
There are plenty of instances where you’ll want to present a table of data on your web page.
If you haven’t worked with tabular data before, it will be useful to know that a table consists of
rows and columns. Each row/column pair has a piece of data associated with it, referred to as a
table cell.
Let’s dive straight in and convert the table below into HTML.
HTML CSS JS
Typically focusing on using HTML to semantically structure your web content provides several
benefits, including:
making your web content vastly more accessible to readers with disabilities
applying styles with CSS will become more consistent and predictable
earch engines will use the semantic information to better understand your web pages
<html>
<head>
</head>
<body>
<form>
A form
</form>
</body>
</html>
Form input:
The most useful component of a form is the input tag, which creates a text field where users
can enter data. Here’s an example:
<form>
</form>
Output
size
value
maxlength
readonly
HTML RECAP
So until now, we have been busy understanding how important html's mastery is.
We have been learning how to :
But, if you take a look at the result, you will find that it’s far away from an actual web page. We
are developing an unattractive web page with no esthetic and forms output.
Right now, the further step is to resolve that problem, and we will start giving some style to our
web pages.
You will find an example in the link below and will recreate the structure using html.
- And Forms.
INSTRUCTIONS
1-Create the navbar: Home,About,Work,Resume,Contact
2-Create the “About” section,”Work” Section,”Resume”
Section,”Contact”Section(Using HTML Forms)
https://drive.google.com/file/d/14heHM4DZ84YFU4uhxFS5gyK1WWIn9EP3/view
QUESTIONS
Question 1
What's HTML?
HTML is short for HyperText Markup Language and is the language of the World Wide Web. It is
the standard text formatting language used for creating and displaying pages on the Web. HTML
documents are made up of two things: the content and the tags that format it for proper display
on pages.
Correct answer
HTML is short for HyperText Markup Language and is the language of the World Wide Web. It is
the standard text formatting language used for creating and displaying pages on the Web.
Your answer
Question 2
What are tags?
Content is placed in between HTML tags in order to properly format it. It makes use of the less
than symbol (<) and the greater than symbol (>). A slash symbol is also used as a closing tag.
For example:
`<h1>hello</h1>`
Correct answer
Content is placed in between HTML tags in order to properly format it. It makes use of the less
than symbol (<) and the greater than symbol (>).
Your answer
Question 3
Do all HTML tags come in a pair?
No, there are single HTML tags that do not need a closing tag. Examples the <br> and the <img>
Correct answer
No
Your answer
Question 4
What are common lists that can be used when designing a page?
You can insert any or a combination of the following list types:
– ordered list
– unordered list
– description list
– menu list
– directory list Each of this list types makes use of a different tag set to compose
Correct answer
You can insert any or a combination of the following list types: – ordered list – unordered list
Your answer
Question 5
How do you insert a comment in HTML?
Comments in HTML begins with less than, exclamation mark and two dash by two dash with
greater than symbol, <! –– and the comment closes with ––>
Correct answer
Comments in HTML begins with less than, exclamation mark and two dash by two dash with
greater than symbol, <--!
Your answer
Question 6
What are the table tags?
HTML Tables are defined with the `<table>` tag. `<tr>` tags are for rows, `<td>` tags are for
column and `<th>` are for the column name
Correct answer
HTML Tables are defined with the `<table>` tag. `<tr>` tags are for rows, `<td>` tags are for
column and `<th>` are for the column name
Your answer
Question 7
What does the div Tag?
Correct answer