Hacker News new | ask | show | jobs
by laumars 4667 days ago
Excuse my ignorance, but can you not use div layers to position your data as well as the header / footer tags?
2 comments

Depends on the meaning of "can" and "div layers". Technically speaking I can do many things, it's just that CSS (before flexbox, as mentioned in the comments) does not have any nice way to say that this element should be displayed before that element and so on.

Not sure what you ment with the layer thing.

In the testing I've done with the aforementioned tags, the display ordering happens correctly on all the desktop and mobile browsers I had to hand, when I wrapped the content in div tags as well as the article et al tags. So I'm wondering if what I've done is: 1) "valid" syntax, 2) would still break in the clients being discussed earlier and thus I was testing the wrong clients or 3) missing the point entirely.

I'm still learning my way through HTML5 (I have had some experience with the markups that proceeded it though), so I just wanted to be clear on the issue :)

re "div layers", that was a foobar on my part. I meant "div tags". Sorry for the confusion.

Unfortunately I think it's 3), you've missed parent's point :) They are not saying that HTML5 tags do not order correctly. They are saying that it's difficult to create a semantic document, where the order of the tags suits screen-readers (i.e. article before nav, as the article is the important part) but the resulting webpage (when styled with CSS) suits viewers (nav at left of article).
Ahhh I see. Thank you for the clarification.
You can, and that is how it's mostly done now.

But that isn't semantically correct. A div tag is just a div tag - like all other div tags.

An article tag is "a div tag", unlike all other div tags. It tells that this is the main part of the webpage.

I see. Thank you :)