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:
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:
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(407 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 :)(343 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?(60 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(7 votes)
- Can you add images using the html?(36 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.(52 votes)
- Is <!DOCTYPE html> necessary?(27 votes)
- It is HIGHLY recommended, otherwise your browser will try to run the code as if it was written in the 1990s. Obviously we have made much progress and code has become more advanced, so your computer will try to 'work out quirks' that can all be avoided by typing <!DOCTYPE html>(31 votes)
- Can someone that has no idea about websites like a beginner start a website?(22 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.(12 votes)
- what are tags(15 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.(20 votes)