Skip to content

Commit

Permalink
Updated the sequence of code snippet under Head element (#28686)
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsijv authored Aug 22, 2024
1 parent 569e638 commit 547b3fd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions foundations/html_css/html-foundations/html-boilerplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ Noticed the word `lang` here? It represents an HTML attribute which is associate
The `<head>` element is where we put important meta-information **about** our webpages, and stuff required for our webpages to render correctly in the browser.
Inside the `<head>`, we **should not** use any element that displays content on the webpage.

Back in our `index.html` file, let's add a `<head>` element with a `<meta>` element and a title within it. The `<head>` element goes within the `<html>` element and should always be the first element under the opening `<html>` tag:

```html
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Webpage</title>
</head>
</html>
```

#### Meta element

We should always have the `<meta>` tag with the charset encoding of the webpage in the `<head>` element: `<meta charset="utf-8">`.
Expand All @@ -78,19 +91,6 @@ If we didn't include a `<title>` element, the webpage's title would default to i

There are many more elements that can go within the head of an HTML document. However, for now it's only crucial to know about the two elements we have covered here. We will introduce more elements that go into the head throughout the rest of the curriculum.

Back in our `index.html` file, let's add a `<head>` element with a `<meta>` element and a title within it. The `<head>` element goes within the `<html>` element and should always be the first element under the opening `<html>` tag:

```html
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Webpage</title>
</head>
</html>
```

### Body element

The final element needed to complete the HTML boilerplate is the `<body>` element. This is where all the content that will be displayed to users will go - the text, images, lists, links, and so on.
Expand Down

0 comments on commit 547b3fd

Please sign in to comment.