Beginners Guide To HTML5 - Setting Up Our Project alongside some Headings and Paragraphs(#1)

  • Thread starter Thread starter kode_block
  • Start date Start date
K

kode_block

NOTE: This Tutorial was written by Me. I've just copied and pasted it from it's Original-Place(Codeforum.org - A Coding Forum by @Malcolmjr96), just to save time of having to write everything. Anyways, I hope you like it. There may also be some parts that are a bit off in which in that case, I do apologize.

Hey there. I figured that since I've seen some People on this Forum wanting to get into HTML5, I thought: "Why not make a Tutorial for Beginners". And so that's what I'm doing.

So to get started with, make sure you have a Text-Editor or IDE. Notepad, Notepad++, Visual Studio 2017 or any other Programming Tool that supports HTML is fine. I'll be using the Version of the Eclipse IDE that was made for Web Development. Once you've gotten your IDE or Text-Editor, just go through the Steps to Set-Up your Project(Which shouldn't take long) and after that, we can get started.

So to start our HTML5 Development, we'll need to write a few things that tells us that this is a HTML File. So write this code first in your IDE/Text-Editor:
HTML:
<!DOCTYPE html>
<html>
    <head>
        <body>
            
        </body>
    </head>
</html>
Every HTML File should contain those Tags. <!DOCTYPE html> & <html> are required for every HTML File, <head> is for things like what charset you're using and the Title that's displayed on your Browsers Tabs. <body> is where all of the Content that's in your Webpage will be displayed(So things like Text, Audio, Video and Images will be displayed in this). If you would like to know more about these Tags then visit w3schools.com to know more and check out the References.

Now that we've declared the Basic things required for every Webpage, we can now get onto adding Content to our Website. We'll start with a Heading. Now in HTML, there are 6 Types of Headings:
  • <h1>(The Largest)
  • <h2>
  • <h3>
  • <h4>
  • <h5>
  • <h6>(The Smallest)

These are all Heading Tags starting from the Biggest(<h1>), to the Smallest(<h6>). Here's an example Photo of them:
6908

That's an Example of what the Headers will look like.

Now, write this in your Code:
HTML:
<!DOCTYPE html>
<html>
    <head>
        <body>
            <!--This is your Heading. Just so you know. I'm a Comment. You'll learn about me later.-->
            <h1>Beginner HTML</h1>
        </body>
    </head>
</html>

Once you have done that, click 'Save As' on your Text-Editor/IDE and save it as 'index.html' or 'index.htm'(.html and .htm are the File Extensions for HTML Files) After you've saved it, open it up in whatever Browser you use, either it be IE, Firefox, Opera or Safari. I'm using Firefox for all of these Examples so depending on your Browser, things may be different. Now once you've opened it, you'll now be able to see your Heading.

Now, let's move onto Paragraphs and Text. A Paragraph or Text is defined using the <p> Tag. All it does is display some Text. Simple. Now let's add it to our 'index.html' Document:
HTML:
<!DOCTYPE html>
<html>
    <head>
        <body>
            <!--This is your Heading. Just so you know. I'm a Comment. You'll learn about me later.-->
            <h1>Beginner HTML</h1>
            <!--This is your Paragraph. It displays Text. I'm just another Commnet which you'll learn about
            soon.-->
            <p>Hey there. I'm a Beginner in HTML. I'm learning the Basics just now but I will be moving on to
            the more advanced stuff soon.</p>
        </body>
    </head>
</html>

Save your 'index.html' File again and open up your Webpage again(If your Browser still has the Webpage open after saving, just refresh to see the changes). You should now see your Text being displayed on your Webpage. Note: You can write Text without using the <p> Tag but your advised to always contain everything in a Tag.

Well, you should now have a Basic Webpage that can be opened up and now know hot Set-Up a Basic Webpage in HTML5. I hope you liked it. Tell me what you think and I'll hopefully Improve the next one.


You can find my Original-Post, here: https://codeforum.org/threads/begin...alongside-some-headings-and-paragraphs-1.166/
 
It looks like you've got <body> nested within <head>, which is semantically incorrect. These are separate structures. You also need to specify lang as an attribute on <html>, provide a <title>, and ideally, charset. Basic HTML structure for any webpage should look like this:

HTML:
<!DOCTYPE html>
<html lang="en-us">
  <head>

    <meta charset="UTF-8">

    <title>Page Title</title>

  </head>
  <body>

    <h1>Hello World</h1>

  </body>
</html>

lang is to be updated based on the country code for the language on the page.

Also, headings shouldn't be thought of based on the size of text they produce, but as a document outline. A semantically-correct HTML structure should have headings appear in descending order of importance (i.e., don't skip heading levels). All pages should contain an <h1> as the page title, ideally only once. Lower-level headings define sub-sections within the page, and can appear multiple times.


Text should always be wrapped in a tag that supports plain text. Includes: <h1> - <h6>, <p>, <td>, and more.

And as a tip, be weary of the information presented by w3schools. It contains outdated, and sometimes wrong information. The Mozilla Developer Network (MDN) is considered a trustworthy reference.

This is a good start! Just needs some corrections.
 
Last edited:
It looks like you've got <body> nested within <head>, which is semantically incorrect. These are separate structures. You also need to specify lang as an attribute on <html>, provide a <title>, and ideally, charset. Basic HTML structure for any webpage should look like this:

HTML:
<!DOCTYPE html>
<html lang="en-us">
<head>

<meta charset="UTF-8">

<title>Page Title</title>

</head>
<body>

<h1>Hello World</h1>

</body>
</html>
I usually have <body> nested inside <head>. It's just how I layout my Code. I do also go over things like <meta> in another HTML Tutorial of mine. I might post that soon.

Also, headings shouldn't be thought of based on the size of text they produce, but as a document outline. A semantically-correct HTML structure should have headings appear in descending order of importance (i.e., don't skip heading levels). All pages should contain an <h1> as the page title, ideally only once. Lower-level headings define sub-sections within the page, and can appear multiple times.
Well, yeah, although Headings shouldn't be thought or based on the size of them, that's how I usually portray them. I look at them based on their size then based on their size, I use them for either Headings or Sub-Headings. And I know that all Pages, should contain a <h1> Heading as the Page-Title. It's not like I don't know that.

And as a tip, be weary of the information presented by w3schools. It contains outdated, and sometimes wrong information. The Mozilla Developer Network (MDN) is considered a trustworthy reference.

This is a good start! Just needs some corrections.
I will remember that for next time. I usually always rely on w3schools for information as I find it much easier to navigate than MDN. Although, I don't usually pay attention to see if the info is outdated. Again, I'll remember that.

And I do hope that you liked it. I think why you had to correct it was because of the way I did things like nest <body> inside of <head> and how I portrayed Headings. I may revise this Tutorial sometime in the future.
 
@OscarDeer I really want to emphasize that it is not correct to have <body> nested within <head>. Ever. It's not a matter of preference, it's literally HTML spec. I say this as a professional developer with 10+ years exp. who specializes in HTML and CSS.

<head> is the part of your page that is not visible within the viewport. It contains information that the browser uses to render your page.

<body> is the part of your page that is visible within the viewport. It contains the content of the HTML document.


I would heavily encourage you to make this change in your tutorial. Again, it's a good start, but it absolutely needs corrections.
 
@OscarDeer I really want to emphasize that it is not correct to have <body> nested within <head>. Ever. It's not a matter of preference, it's literally HTML spec. I say this as a professional developer with 10+ years exp. who specializes in HTML and CSS.

<head> is the part of your page that is not visible within the viewport. It contains information that the browser uses to render your page.

<body> is the part of your page that is visible within the viewport. It contains the content of the HTML document.


I would heavily encourage this change in your tutorial. Again, it's a good start, but it absolutely needs corrections.
Well, I thought wrong then. I've only being doing HTML for about two years so what do I know. But I'll get better overtime. Come to think of it, I might correct everything later or just revise this Tutorial sometime in the Future.

Again, I will keep this in mind. I thank you for your Feedback.
 
@OscarDeer A firm understanding of HTML semantics is the best place to start. This is important not just for the sake of being correct, but also for maintainability, accessibility, and SEO performance. These articles are helpful:

 
@OscarDeer A firm understanding of HTML semantics is the best place to start. This is important not just for the sake of being correct, but also for maintainability, accessibility, and SEO performance. These articles are helpful:

I do agree that having a good, firm Knowledge of HTML is important. I'll check those Articles later. Thanks.
 
Back
Top Bottom