DEV Community

Cover image for HTML Basics Part ✌️
Austin
Austin

Posted on

HTML Basics Part ✌️

If you haven't read the previous article on getting started with HTML check out Part 1 here:

Since we last left off we ended up with a document that looks like this:https://dev.to/amsuarez/html-basics-part-ii-4ah6

<!DOCTYPE html> 
<html lang="eng">
 <head> 
 </head>
 <body>
 </body>
</html>

Today we are going to over the basics on creating content within the body. The three we are going to be covering to day are heading tags, paragraph, and comment tags.

Heading Tags

Heading tags are a great way to define importance in a document. Heading tags exist for 1 - 6 each heading level will have its own default styling. It is important to understand that you can restyle these tags in css but using appropriate tags is important. Screen readers recognize these levels, users can skim through the document based on the levels, and search engines can use them for indexing.

<!DOCTYPE html> 
<html lang="eng">
 <head> 
 </head>
 <body>
  <h1>My Website</h1>
  <h2>My Projects</h2>
 </body>
</html>

Paragraph

Paragraphs are general areas to hold text. You can use it for a lot of text or even just a couple of words.

<!DOCTYPE html> 
<html lang="eng">
 <head> 
 </head>
 <body>
  <h1>My Website</h1>
  <h2>My Projects</h2>
  <p>I write a blog about HTML</p>
 </body>
</html>

Comments

Lastly is for this article we will showcase how to write comments. Comments are not displayed in the browsers. They are useful to explain your code and ideas to others reading and most of the time for yourself. The comment tag is shown as <!-- -->.

<!DOCTYPE html> 
<html lang="eng">
 <head> 
 </head>
 <body>
  <h1>My Website</h1>
  <h2>My Projects</h2>
  <!-- Here I will write about my projects. -->
  <p>I write a blog about HTML</p>
 </body>
</html>

That's it for this article hopefully you enjoyed it!
Follow and like for future web dev basics and advanced tips.

Top comments (0)