Which tag can be either a container or non-container tag?

Which tag can be either a container or non-container tag?
This course question for my online class has me stumped. Anyone?

Welcome, Cindy.

Note: I am not sure.

Best Guess: If a “container” tag is something akin to a div or p tag, and a “non-container” tag is something akin to a link tag, then a script tag could be one that falls as either/or.

As I said, I am not sure. Especially, since the contents/use of a script tag might not make it either.

Out of interest, which course is this?

Also, I have moved your post into a more relative sub-forum. The #curriculum-help:html-css sub-forum is for the freeCodeCamp curriculum.

1 Like

Hey, thanks. This is for a class called Coding for Scratch at Eastern Gateway Community College. The instructor clarified saying that a “non-container” tag can also be called an “empty” tag. Does this help?

Well, that makes me think of the br tag, and such. There is not just one that stands out, though.

1 Like

An empty container tag is still a container tag, just one that has no contained elements. There is one tag I know of that’s special though, but I’ll stick it in a spoiler:

It’s the <li> tag. It doesn’t need a closing tag if another <li> tag appears where the close tag would need to be. The <p> tag used to behave this way too, but no longer does.

1 Like

Chuck, you are my hero. I actually made that “container tag can be empty” point to my instructor and he was not buying it. I’ve been researching for hours and finally decided to give this forum a try. I’m probably too old to try to learn coding but I’m not happy unless I’m frustrated. That’s why I thought learning to code would be a great way to torture myself. It has not disappointed.

Thanks again.

Seem like an oddly worded question.

Here is a list of empty elements and here is more info on valid tag omission.

PS: You are never too old to learn something new.

1 Like

If your course is asking for the answer I gave, then it’s looking for a pretty obscure piece of historical HTML trivia. If it’s looking for some other tag like <script> then it’s just plain wrong (it always requires a closing tag, and while it has content, it’s still not a container). Otherwise the question is just vague and confusing, and the actual challenge is to find the answer that satisfies an instructor with arbitrary requirements and even less actual knowledge. Welcome to academia.

1 Like

I thought it was oddly worded too but I chalked that up to my inexperience. I’m glad it wasn’t pure ignorance on my part. Thanks for boosting my morale today. :slight_smile: And thanks for the info. Every little bit helps.

Chuck, you have made me feel far less inferior. I can’t thank you enough. I figured this question was as much as test of endurance as a valid learning point. Thanks so much for your help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.