Live data from Hacker News

The ﹤main﹥ element

html5doctor.com

41–50 of 93 posts

Re: The ﹤main﹥ element

#41
post #23

Earlier quoted context omitted.

Excuse my ignorance, but can you not use div layers to position your data as well as the header / footer tags?

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.

Re: The ﹤main﹥ element

#42
post #29
post #23

Earlier quoted context omitted.

Excuse my ignorance, but can you not use div layers to position your data as well as the header / footer tags?

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 :)

Re: The ﹤main﹥ element

#44

I'm still waiting for some sort of or element to markup comments and other such tripe. E.g.: Buy my pills! It would be even more useful if something like this works: Buy pills here! This is cleaner than putting the attribute on every anchor, I wouldn't mind crawlers skipping marked comment sections entirely either.

Would be useful to also sandbox it against running any javascript etc. contained therein.

html5 iframe allows this [0], but i think it'll be difficult to shim in browsers that don't support it.

[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...

Re: The ﹤main﹥ element

#46
post #44

Earlier quoted context omitted.

Would be useful to also sandbox it against running any javascript etc. contained therein.

html5 iframe allows this [0], but i think it'll be difficult to shim in browsers that don't support it. [0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...

Thanks. I had a vague memory that there was something that did it, but couldn't remember what.

Re: The ﹤main﹥ element

#47
post #40
post #37

I was honestly a little baffled to come into this thread and discover people were having trouble with semantic HTML. It's not hard to use, you just need to be inventive with your CSS. A page without divs, spans, strongs and bigs should be everyone's goal.

Could you show us one of your websites "without divs, spans"?

Not easy, but doable, especially on a straightforward design: e.g. http://tumbledry.org/

Re: The ﹤main﹥ element

#48
post #41

Earlier quoted context omitted.

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 s…

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).

Re: The ﹤main﹥ element

#49
post #41

Earlier quoted context omitted.

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 s…

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.

Re: The ﹤main﹥ element

#50
post #4

Has anyone used all of the HTML5 tags in anger? I've tried a couple of times to build something fully "semantic". I struggle to create something that looks good semantically (ie just reading the HTML) and is also laid out on the page in the way I wanted it to be. There seem to be lots of situations, even in just mildly complicated web pages, where you need to write HTML code solely for graphics / layout reasons that…

Yeah, I know we were all excited about the new elements when they were playing about with them, but I was kinda skeptical as a web newbie doing pure productivity apps... I mean, the web is prettymuch an application engine now and we're doubling down on the document metaphor? What?

I still think that CSS in particular maps terribly to its usage as a complete layout system. I mean, you can do it, but you can code in BF or do incredible things with template metaprogramming in C++. Doesn't make it a clean, pleasant way to work, and doesn't really fit the designed purpose.

Post reply on HN