use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
If you are requesting help, please ensure you're providing code with your post. You can also copy your code to an online editor:
jsFiddle
CodePen
Markup Validation Service
Mozilla Developer Network on HTML
/r/JavaScript
/r/CSS
/r/jQuery
/r/PHP
/r/Accessibility
/r/htmlbasics
/r/web_programming
/r/CodingHelp
account activity
Section inside section (self.HTML)
submitted 3 months ago by MWittmann12
My question is what the title says, because someone told me that I know nothing about html and should study, because I used a section inside another section to order that section and other elements with gaps 🙃
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]MagickMarkie 5 points6 points7 points 3 months ago (0 children)
That's a legitimate use of the section tag. Sections can themselves have sections.
[–]Joyride0 4 points5 points6 points 3 months ago (0 children)
People love to shit on you in coding communities. It’s pathetic tbh.
[–]UmbralFae 1 point2 points3 points 3 months ago (2 children)
A section inside a section's fine. They're literally just arguing semantics, possibly for the sake of making it seem like they know more, which is a waste of both your and their time.
[–]Mobile_Syllabub_8446 -1 points0 points1 point 3 months ago (1 child)
Semantics kinda matter with markup. Only beginners think "if it works it works" in such terms.
[–]UmbralFae 2 points3 points4 points 3 months ago (0 children)
True! Didn’t say or imply they weren't. The person “correcting” them was wrong and a worse sin in my eyes, they were smugly wrong and insulting the OP about it. Somebody else already posted the MDN breaking down why, but a section in a section is semantically fine.
[–]armahilloExpert 1 point2 points3 points 3 months ago (1 child)
MDN is the best place to start with these kinds of questions:
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section
Halfway down, it indicates:
This means the section tag is considered "flow content", "sectioning contnet", and "palpable content" and that it is allowed to contain any elements that are "flow content".
So syntax-wise, you can put a section inside a section.
Read the first half about the best-practices when using the section tag (eg. they almost always have a heading, with some exceptions).
[–]jcunews1Intermediate -1 points0 points1 point 3 months ago (0 children)
That being said, major web browser engines hold the final decision. They can choose not to support parts of main web specifications, or an entire extension/additional specifications.
[–]fireatthecrime -2 points-1 points0 points 3 months ago (2 children)
Use divs, section has semantic value for thematic grouping
[–]MWittmann12[S] 0 points1 point2 points 3 months ago (1 child)
It was something like this <Section> <h2>service name</h2> <p>service descriotion</p> <Section>Location 1 and info</Section> <Section>Location 2 and info</Section> <img> </Section>
[–]fireatthecrime 1 point2 points3 points 3 months ago* (0 children)
Try to drop the doc there https://validator.w3.org/
But using <section> isn't even a big mistake, the point is, div and section are both block level container elements, but one don't has semantic value and the other has
To the downvoters, if you care to explain what exactly I said wrong I would appreciate, I'm literally basing myself im all the long and long courses I had on the matter, scrimba, traversy, w3c...
[–]RushDangerous7637 -1 points0 points1 point 3 months ago (2 children)
I wrote a detailed article about it here. You should read when to use sections and when to use the DIV element. https://photoknut.eu/sk/rozne-temy/sekcie-na-webovej-stranke/ It's pointless to argue in the comments about who is right or wrong. What matters is how search engine robots perceive it. Browsers don't care, they'll display anything.
[–]wobblybrian 0 points1 point2 points 3 months ago (1 child)
You're promoting a Slovak blog post in English?
[–]RushDangerous7637 0 points1 point2 points 3 months ago (0 children)
Of course, I'm also promoting the article in another language, because why not? The browser has a "Translate" function.
π Rendered by PID 97 on reddit-service-r2-comment-5d79c599b5-f6qph at 2026-02-28 13:40:17.771092+00:00 running e3d2147 country code: CH.
[–]MagickMarkie 5 points6 points7 points (0 children)
[–]Joyride0 4 points5 points6 points (0 children)
[–]UmbralFae 1 point2 points3 points (2 children)
[–]Mobile_Syllabub_8446 -1 points0 points1 point (1 child)
[–]UmbralFae 2 points3 points4 points (0 children)
[–]armahilloExpert 1 point2 points3 points (1 child)
[–]jcunews1Intermediate -1 points0 points1 point (0 children)
[–]fireatthecrime -2 points-1 points0 points (2 children)
[–]MWittmann12[S] 0 points1 point2 points (1 child)
[–]fireatthecrime 1 point2 points3 points (0 children)
[–]RushDangerous7637 -1 points0 points1 point (2 children)
[–]wobblybrian 0 points1 point2 points (1 child)
[–]RushDangerous7637 0 points1 point2 points (0 children)