Live data from Hacker News

The ﹤main﹥ element

html5doctor.com

81–90 of 93 posts

Re: The ﹤main﹥ element

#81
post #78

Earlier quoted context omitted.

"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" I recently ditched Wordpress and decided to learn HTML and CSS by hand-coding my blog. I used many (but not all) of the new HTML 5 tags including main, section, article, nav, footer. Admittedly a blog is quite a structured type of site that len…

If clean and clear is what you're going for, I personally think you've done a good job!

That's great to hear. Thanks :-)

Re: The ﹤main﹥ element

#82
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"?

I don't have any live right now, so you'll need to take my word when I say I'm been using semantic HTML for more than a decade (since I started coding.) My rules are no divs, no spans, no imgs (unless the image is part of the content rather than the presentation), no empty elements, no spacers, and no non-semantic classes or IDs. When you try it, remember that :after and :before give you the ability to add arbitrary content to a page, be it text or image.

If it sounds hard, remember that people said the same thing about making layouts without tables in the early 2000s. Semantic and compliant HTML means a more accessible website and that's more important than literally anything else in web development.

Re: The ﹤main﹥ element

#83
post #65

Earlier quoted context omitted.

That's pretty lame. It just navigation and some text dumped into the body. I'm not 100% sure, but I think having outside of is not up to HTML5 standards.

Implicit body element without an explicit tag as used in the page at issue is, IIRC, consistent with WHATWG HTML, not sure about W3C HTML5.

No, he has this strange structure:

    
        
        ...
        
    
    
    ...
    

Re: The ﹤main﹥ element

#84
The header goes inside of body now? If so then now header no longer means header. For that matter, main seems to be doing what body is supposed to do? Personally I think it should be:

  
  [...]
  
  

  
  [...]
  

  
  
  [...]
  
Why change the expectations for where a header goes after around two decades?

Re: The ﹤main﹥ element

#85
post #40

Earlier quoted context omitted.

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/

Surprisingly readable, both human and machine. Thanks, that's enlightening :)

Re: The ﹤main﹥ element

#86
post #83

Earlier quoted context omitted.

Implicit body element without an explicit tag as used in the page at issue is, IIRC, consistent with WHATWG HTML, not sure about W3C HTML5.

No, he has this strange structure: ... ...

When I looked over the source (quickly) it looked like an implicit-body structure. I must have missed the body tags.

Re: The ﹤main﹥ element

#87
post #84

The header goes inside of body now? If so then now header no longer means header. For that matter, main seems to be doing what body is supposed to do? Personally I think it should be: [...] [...] [...] Why change the expectations for where a header goes after around two decades?

Are you mistaking header and head?

Re: The ﹤main﹥ element

#88
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"?

Currently only running in FF because of Fat Arrows and being under dev, but this page only uses divs for the js generated content in the simulation.

http://eborden.github.io/evolution-of-cooperation/

Re: The ﹤main﹥ element

#89
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…

I think that CSS is the biggest failure here. Let's say I have a blog, so for article page markup should be something like this: lorem ipsum search That way screen readers, search engines, etc will get the important stuff first and less important stuff afterwards. But since the common way of presenting blog is more like this: search I either have to do some hacky position:absolute things, crazy floats with negative e…

"I either have to do some hacky position:absolute things…"

Why do you think this is "hacky"? This is precisely what absolute positioning is for.

Re: The ﹤main﹥ element

#90

Question: is there any evidence that search engines actually use/respect semantic tags like , , , etc.? Or anyone here who knows firsthand from Google? Just because, if I were writing a search engine, I would already have a bunch of "AI"/heuristics logic to tease these things out, since most sites don't use semantic HTML5 -- and it would probably do a solid job, since it's easy to compare a bunch of pages from a sing…

In this case, it's more about accessibility with WAI-ARIA than it is about SEO.
Post reply on HN