Main content
Computer programming
Course: Computer programming > Unit 2
Lesson 1: Intro to HTMLQuick tip: HTML tags
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)
- Tags are those things you see in the chat in roblox when someone says a bad word(7 votes)
- what does HTML stand for and why?(14 votes)
- HTML stands for HyperText Markup Language.(20 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
title
tag 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.
Themeta
tags 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)