Hour of Code
- Welcome to the web!
- HTML basics
- Quick tip: HTML tags
- Challenge: Write a Poem
- HTML: Text emphasis
- Challenge: You can learn text tags
- HTML: Lists
- Challenge: Wishlist
- HTML: Images
- Challenge: A picture-perfect trip
- CSS Basics
- Project: Holiday card
- Go beyond the hour
Before you dive into the challenge, here's a quick review of HTML tags:
Diagram of an HTML tag anatomy
The closing tag always comes after the content of the tag - it's how the browser knows that you want the tag to end.
The contents of an HTML tag are the stuff that goes between the opening and closing tags - this is what we mean when we say "inside" a tag. The contents of a tag can be normal text or a mix of other tags.
Where should your tags go?
Any content that is visible on your web page should go between the opening <body> tag and the closing </body> tag, like in the screenshot below:
Screenshot of HTML code and diagram
The <h1> and <p> tags are the contents of the <body> tag, so we say they're "inside" the <body> tag. In fact, those tags must go inside the <body> tag, so remember that when you're writing your HTML in your first challenge. Try it out now!
Want to join the conversation?
- is the closing tag matter whether or not you use a forward or backward slash(391 votes)
- Up vote to The Porkintosh Studios.
To add to their answer, the back slash is used an "escape" character in most programming languages which is probably why they chose the forward slash for closing tags in HTML. When creating HTML they could have decided on any character like a "*", or "%" but "/" just looks nice, and it's easy to type :)(328 votes)
- What code command is necessary to enable highly sophisticated characters such as those of other languages? Additionally, is it more effective to write all of the code under one (<body>"tag") or split it up between multiple through out the code?(54 votes)
- you can use charset "utf 8" meta tag to render different languages if your character is still not rendering then you can use utf 16 or 32 that should cover any given character(5 votes)
- Can you add images using the html?(33 votes)
- Yes, with the <img> tag. here's an example :
<img src=flower.png alt=Flower width=200 height=170>. that would display an image called flower.png and if the image could not display it will display the word Flower.(50 votes)
- Can someone that has no idea about websites like a beginner start a website?(21 votes)
- It could be a start, But once you think you used the code <html> with the information that you want your users to see.(5 votes)
- how and where can I start practicing?(20 votes)
- You could also download an app called notepad or notepad++ and practice with that. personally, I prefer notepad++ but you can choose whatever you like.(11 votes)
- Is <!DOCTYPE html> necessary?(26 votes)
Ok, it's not COMPLETELY necessary, but Oh Noes pops up if you don't have it, and it just looks weird(2 votes)
- what are tags(14 votes)
- what does HTML stand for and why?(14 votes)
- Why is it that line breaks doesn't have closing tag.(14 votes)
- Good question. A line break tag,
<br>, does not have a closing tag. This is because it does not wrap around any kind of element that we need to display. It just skips a line.(14 votes)
- What is the purpose of <title> tag if it is not displayed and what do you write in the <meta> tag.(8 votes)
- What you put in the
titletag shows up on the tab in the browser and when you hover over the tab. It's also used when you search for the site.
metatags can be used to provide information that describes the site including author, description, keywords, etc. that are important for search engines.
You general also put the charset in as a meta tag which tells the computer what set of characters it should use.(19 votes)