The code for each HTML element is called a HTML tag which tells the computer which type of element to show, just like each cat food sachet has a label on it telling you what flavour it is. Every HTML tag starts the same way, with the following two symbols:
< >
This code declares the beginning of a HTML tag and it tells the computer that you are going to add a new HTML element. In between the symbols is where you describe what the element will actually be.
Going back once again to cat food, if you could describe cat food flavours in HTML you may write it like this.
<duck>
<poultry>
<turkey>
To close the tag, you simply repeat the opening part of the tag but include a forward slash, which looks like this.
/
So your complete HTML code for these cat food flavours may look like one of these. In each case the code has an opening part and a closing part and they each have the same word in. There's no need to have each tag on a different line but it certainly makes it easier to read.
<duck> </duck>
<poultry> </poultry>
<turkey> </turkey>
What if I want a mix of flavours?
Can I have some turkey and some duck by mixing the tags?
I hope this question is about HTML and not dinner.
Of course it’s about HTML.
No, you can’t mix tags. If you do you can’t guarantee what your code will look like.
One browser may read it one way and a different browser could read it another.
Does that answer your question?
It does. Also I lied I was asking about dinner. I want duck and turkey.
Aria Wanted Duck And Turkey And Got Munchies Instead
Try writing opening and closing HTML tags for food in the boxes below:
If the words in the opening part of your tag and closing part of your tag are different your code won't work properly and so you won't know what it will look like. This is also true if you forget the closing tag so it’s very important to keep track of your tags to make sure you have the right amount and that you have used them correctly.