HTML Basic

HTML Basic

Creating our first web page


All HTML documents must start with a document type declaration

<!DOCTYPE html>

When you create an HTML file you should put that Document Type Declaration on top at first line. ( İt should be your first HTML code )

HTML5 Tutorial, DOCTYPE html

NOTE:

  • You need a Document type Declaration once per each web page ( HTML file)
  • İt should be on top at first line of code
  • Your first code in an HTML file

The HTML <html> </html> Tags

Once you have Doctype declaration at first line of code. Next you need to write:

  • Opening <html> tag. Also know as ‘ Start tag ‘
  • Closing </html> tag . Also known as ‘ End tag ‘
<!DOCTYPE html>
<html>
 
</html>
İn text editor

The HTML document itself begins with <html> and ends with </html>.
What it means is that everything we have on websites are inside these tags. Our contents goes in between
opening <html> … </html>
NOTE:
From here everything goes inside <html>…</html> tags

<!DOCTYPE html>
<html>
 content goes here
</html>

The <head> and the <body> tags

Now above we said that ” everything goes inside <html>…</html> tags “

Well, that’s true. But websites have two parts

  • Head – ( For search engines such as Google Chrome, Safari, Mozilla etc..)
  • Body – (For humans and visible parts such as text, images, videos, tables, forms etc…)

So the next step is we have to add head and body tags inside of html tags which come in pairs like this:

<!DOCTYPE html>
<html>

  <head></head>

  <body></body>

</html>

Remember that the head part is for search engines, linking files. And the body part is the visible part of web pages such as texts. images, videos, forms etc…
Now let’s create our first web pages which says: ” Hello World ”

<!DOCTYPE html>
<html>
 
  <head></head>
 
  <body>
  <p> Hello World </p>
 </body>
 
</html>

Try it on Codepen




Comments are closed.