Ok, probably not many people here will know Swedish, but...
Are HTML elements "i" or "på" eachother?
The reason I ask is because I could argue a case for either.
<html lang="se-SV"">
<head>
<!-- ... -->
</head>
<body>
<p>
Jag är en HTML-paragraph-tag, och jag är i
<!-- However you'd say "the body tag". -->
</p>
</body>
</html>
The written form of HTML supports using "i" for describing element relationships.
BUT.
From a non-technical standpoint, you'd find that the browser renders the elements from the outer-most layer to the inner-most.
So we get (kind of) the reverse of the last argument.
Maybe you could use either depending on if you're talking about its technical sense or not, but I don't know which I should use.
Some input, even if it's an opinion, would help.
Thanks in advance!
Cheers!
Cheers!
Top comments (7)
I’d say it’s both. In how HTML is written, it is with no doubt “i”. But in how it is displayed, I’d argue it is also both. If you have a small green box, and inside the element you put a big red box, it will be “på”. But if you add the
overflow: hidden;
CSS rule for the green box, the red box will be “i”.And it's "på" the green box, even if it's still technically "i" the green box?
(Because assuming there's no other styling except for the
overflow:hidden;
case, the green box would expand to fit the red one, if I remember right.)To be clear, I meant something like this:
In this case the inner div will arguably be “på” the outer div as long as you don’t add the
overflow: hidden;
css rule.Thanks.
This is very useful!
Im Norwegian but still understand what you mean. The question is wether elements are stacked on top of each other (på), or are lying in each other (in). I think you should use “in”, because it’s the correct one from a technical point of view, but also kinda correct from a non-programmer point of view, as you have boxes ‘inside’ other boxes. So I’d go for “in”.
Thank you for your input! :)
This has shown to be the consensus thus far
New HTML element
<på></på>
just dropped 😏