Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add index.html #2

Merged
merged 4 commits into from
Jul 24, 2018
Merged

Add index.html #2

merged 4 commits into from
Jul 24, 2018

Conversation

Feyn-Man
Copy link
Owner

Add index.html

@github-learning-lab
Copy link
Contributor

Step 3: Add HTML document structure

Great job opening a pull request @Feyn-Man! I've gone ahead and closed your previous issue.

This pull request contains some content, but it doesn't have any of the HTML structure that tells a browser how to structure the content. All pages created with HTML must contain tags that identify it as such. The tags look like this:

<html>
    <body>
        The HTML content goes here.
    </body>
</html>

You may notice two copies of the HTML tag, and two copies of the body tag. We call these the opening and closing tags. Let's look at the same code, but include a little explanation.

  • <html> is the opening HTML tag
  • <body> is the opening body tag
  • </body> is the closing body tag
  • </html> is the closing HTML tag

In HTML, spacing doesn't really matter. We've added some tabs to make the code easier to see, but the web browser will ignore the extra spacing. Now that you understand the building blocks of HTML, let's add HTML to the index.html file in your project.

⌨️ Activity: Add the html and body tags to index.html

  1. Click on Files Changed to see the newly added index.html file.
  2. Click on the 📝 to edit the file.
  3. Before the existing content, add an opening <html> tag, and an opening <body> tag.
  4. After the existing content, add a closing </body> tag, and a closing </html> tag.
  5. In the Commit changes section, enter a commit message that describes what you've done.
  6. Ensure you've selected Commit directly to the add-index branch.
  7. Click on Commit changes.

Watch below for my response

Copy link
Contributor

@github-learning-lab github-learning-lab bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 4: Add a page title

Your web page is beginning to take shape! HTML and body tags are important, but their effect isn't too visible. Next, we'll make a visible change, by giving your page a title. Your page's title will show up on the title bar in your web browser, or as the title of any tabs you've got open. The title is used in all sorts of other places!

a screenshot of the title on a browser tab

The title tag looks like this:

<title>I am a title!</title>

But the title tag must be inside of a head tag. By now, you've noticed that tags have a hierarchical structure. In our prior example, the html tag was the parent of the body tag. In a similar fashion, the head tag will be the parent of the title tag, like so:

<head>
    <title>I am a title!</title>
</head>

Finally, the head and title tags, will be children of the html tag, but siblings of the body tag.

<html>
    <head>
        <title>I am a title!</title>
    </head>

    <body>
        Some content.
    </body>
</html>

⌨️ Activity: Give your page a title

  1. Click on Files Changed.
  2. Click on the 📝 to edit the file.
  3. Place an opening <head> tag and an opening <title> tag after the first opening html tag, but before the body tag.
  4. Write out a title after the opening title tag.
  5. Place a closing </title> tag and a closing </head> tag after your new title, but before the body tag.
  6. In the Commit changes section, enter a commit message that describes what you've done.
  7. Ensure you've selected Commit directly to the add-index branch.
  8. Click on Commit changes.

Watch below for my response

Copy link
Contributor

@github-learning-lab github-learning-lab bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't detect opening and closing head and title tags. Here are some troubleshooting steps:

  1. Check your spelling. We're checking specifically for the tags: <head>, <title>, </title>, and </head>.
  2. Check the order of your tags. The opening <head> tag should appear first, followed by the opening <title> tag, then the title itself, the closing </title> tag, and the closing </head> tag.
  3. Make sure you placed the head and title tags after the <html> tag, but before the <body> tag.
  4. Ensure you modified the index.html file, and not some other file.

Let's try again!

⌨️ Activity: Give your page a title

  1. Click on Files Changed.
  2. Click on the 📝 to edit the file.
  3. Place an opening <head> tag and an opening <title> tag after the first opening HTML tag, but before the body tag.
  4. Write out a title after the opening title tag.
  5. Place a closing </title> tag and a closing </head> tag after your new title, but before the body tag.
  6. In the Commit changes section, enter a commit message that describes what you've done.
  7. Ensure you've selected Commit directly to the add-index branch.
  8. Click on Commit changes.

Copy link
Contributor

@github-learning-lab github-learning-lab bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 5: Merge your first pull request

🎉 Everything's going so well @Feyn-Man! Now that you've got all the bits for a proper HTML page, let's merge it in and see how the browser interprets it.

⌨️ Activity: Merge the HTML, head, title, and body tags

  1. Click on Merge pull request below.
  2. Click on Confirm merge.
  3. Click on Delete branch.

Watch below for my response

@Feyn-Man Feyn-Man merged commit b6de74a into master Jul 24, 2018
@github-learning-lab
Copy link
Contributor

Great! I've opened a new issue for you.


Go to the next issue here!

@Feyn-Man Feyn-Man deleted the add-index branch July 24, 2018 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants