PDF

What is HTML?

HTML stands for Hypertext Markup Language. It's the standard language used to create pages on the Internet. Think of HTML as the structure of a web page, like a skeleton that shapes how everything looks.

Basic Structure of HTML

Every HTML document starts with a special set of tags. Here’s what that looks like:

<!DOCTYPE html>
<html>
  <head>
    <title>My First Web Page</title>
  </head>
  <body>
    <h1>Welcome to My Website!</h1>
    <p>This is a paragraph on my first website.</p>
  </body>
</html>

Breaking Down the Structure

  • <!DOCTYPE html>: This tells the browser that the document is HTML5.
  • <html></html>: The root element that contains all your HTML code.
  • <head></head>: Contains meta-information about the document, like the title.
  • <title></title>: This is the title of your page that appears on the browser tab.
  • <body></body>: This is where the content of your web page goes, like text and images.

Adding Content

You can add different types of content using various HTML tags:

  • <h1>...</h1>: This is a heading. You can use <h2>, <h3> for smaller headings.
  • <p>...</p>: This tag is for paragraphs.
  • <a href='...'>...</a>: Creates a link to another page or website.
  • <img src='...' alt='...'>: This is for adding images. The 'src' attribute is the image location and 'alt' is alternative text for accessibility.

Example of a Simple Web Page

Here’s a complete example that combines everything we’ve talked about:

<!DOCTYPE html>
<html>
  <head>
    <title>My Fun Website</title>
  </head>
  <body>
    <h1>Welcome to My Fun Website!</h1>
    <p>I love learning about HTML!</p>
    <a href='http://www.example.com'>Click here to visit Example.com</a>
    <br/>
    <img src='https://www.example.com/image.jpg' alt='An example image'>
  </body>
</html>

Conclusion

HTML is a simple yet powerful language for building web pages. By learning these basics, you can start creating your own websites and expressing your ideas online. Keep practicing, and you'll improve your skills over time!


Ask a followup question

Loading...