Head Section in HTML | Day 02 of HTML Learning Series

Welcome back to Day 02 of our 10-day HTML learning series! The last article, we learned about the Basics of HTML, and today, we're diving into one of the most crucial parts of any HTML document: the <head> section.


If you miss the Day 01 Check out the link

Introduction to html

What is <head> Section

The <head> section is like the control center of your webpage. It contains meta-information about your page, like the title, character set, and links to stylesheets or scripts.

Everything you place inside the <head> tags (<head>...</head>) helps browsers and search engines understand your page better.

1. <title>: The Title of Your Webpage

It sets the title of your webpage that you see on the browser tab. It also shows up in search engine results, making it essential for SEO (Search Engine Optimization).


  
<head>
  <title>My Awesome Website</title>
</head>

In this example, "My Awesome Website" will be the title displayed on the browser tab.

2. <meta charset="UTF-8">: Universal Character Encoding

The <meta> tag provides metadata about the HTML document. The charset="UTF-8" attribute is particularly important because it ensures that your webpage can display text in any language, making your content accessible to a global audience.


  
<head>
  <meta charset="UTF-8">
</head>

Using this tag, you guarantee that special characters, symbols, and different languages are displayed correctly on your site.

3. <link>: Connecting Stylesheets

The <link> tag is used to link external resources to your HTML document. Most commonly, it's used to connect a CSS file that defines the styles for your webpage.


  
<head>
  <link rel="stylesheet" href="styles.css">
</head>

In this example, the webpage links to an external CSS file named "styles.css," which contains all the style rules for your page.

Stay tuned for Day 03.

Happy coding! 💻
Previous Post Next Post