.png)
HTML5 Introduotlon
What is HTML5?
HTML stands for hyper text markup Languagel, it is easy and fun to learn.
HTML5 describrs tha structure of web pages.
HTML5 is tha fifth and current major version of tha HTML standard.
Why learn HTML5?
It is essential to learn HTML if you want to build web sites, you can’t build one if you don’t know HTML because it’s one of tha prerequisites in learning other languages used for web development,
Try it Yourself
For you learn faster and see how our examples would actually look like similarly on a real browser we have implanted a simple Try it Yourself Editcr with syntax highllghting where you can play experiment with the example codes given.
Example
<! DOCTYPE html>
<html>
<head>
<title> Hello World! </title>
</head>
<boby>
<hl> This is a heading </h1>
<p> This is a paragraph. </p>
</body>
</html>
TRY IT YOURSELF >
Example Explalned
• <! DOCTYPE html>: this declares the document type which is HTML5
• <HTML>: this element encloses everything inside of an html document; it includes tags elements, style sheets, scripts, text, metadata and a lot more.
• <head>: this element encloses the metadada of a document which will not be displayed on the main content of a web page; this could include style sheets, scripts,<title>,<meta> tags and a lots more.
• <title>: this element defines the title of a web page; it appears on the upper-part of a browser.
• <body>: this element encloses elements like <h1>,<p>,<img>,<b>,<i> and a lot more.
• <h1> : this element defines a heading.
• <p>: this element defines a paragraph.
HTML Tags
HTML Tags are element names surrounded by angle beackets.
In HTML we start and tags. Look at the example below.
<p> Hello, welcome to Learn HTML . </P>
Start Teg and End teg
• Start teg-also called “opening a teg”.Example:<p>
• End teg-also colled “ending a teg” Example: </p>
This is the basic structure of any HTML page. Memorize them!
<! DOCTYPE html>
<html>
<head>
<title> The Title </title>
</head>
<boby>
</boby>
</html>
HTML Editors
Where cen I edit/create HTML files?
In a text editor! Creating HTML files is free you don’t need to download expensive applications to do so.
Look at the list below for some free apps you could use to edit HTML files.
• Notepad
• Notepad ++
• TextEdit
• Sublime TextEdit
• VIM
• ATOM
• Visual Studio Code
• Brackets
• Quoda (Androil app)
• QuickEdit (Androil app)
• DroidEdit (Androil app)
• HTML Editor (Androil app)
• Dcoder (Androil app)
• This app! We have a micro code wditor with syntax highlighting and can save and open HTML Files.
Those are the most commonly used text editors for creating html files.
You can download any application you want.
Saving HTML Files
You need to save your files with the .html file extension. For example, mywebpage.html.
If you don’t save your files with the .html file extension, you won’t be able to run it on browsers.
<p> Hello World! </p>
Lets try it by following these steps:
1. Click the TRY IT YOURSELF button above.
2. Click the menu icon on the upper-right corner.
3. Click SAVE AS.
4. Type mywebpage.html. on the provided field.
5. Click SAVE.
Just as easy as that, your HTML file is saved.
HTML Elements
HTML Elements
In the First lesson we have studied about tags and things like start tag (opening a tag) and end tag (closing a tag).
An HTML element is usually composed of a “Start Tag”, “Element Content” and an “End Tag”.
Example:
<p> This is an element content. </p>
Output:
This is an element content.The example HTML Element above is composed of the Following:
• Start tag: <p>
• Element content: This is an element content,
• End tag: </p>
• Element content: This is an element content,
• End tag: </p>
Example:
<h1> Learning HTML Elements </h1>
Output:
The example HTML Element above is composed of the Following:• Start tag: <p>
• Element content: This is an element content,
• End tag: </p>
Nested HTML Elements
There are some casea that an HTML element can contain one or more HTML elements.For you to better understand it look at the example code below.
<p> <i> Italicized text </i> </p>
Output:
Italicized textThe example nested HTML Elements above are composed of the following:
• Start tag. <p>
• Start tag. <i>
• Element Content. Italicized text
• End tag. </i>
• End tag.</p>
On the example above, there are two start tags and two end tags.
The second tag i.e.<i> italicizes the text within.
Empty Elements
Empty Elements are elements that do not have an element content and an end tag.
A list of commonly used Empty Elements:
A list of commonly used Empty Elements:
• <meta />
• <link />
• <img />
• <br />
• <hr />
• <input />
The best practice in HTML Empty Elements is always put a forward slash / sign before the greater that > sing.
In this way they are closed at their start tags.