I would like to see a version for those of us that structure our documents.
What is this structure you speak of? Most people assume HTML has a 'head' and a 'body'. The head has script and tag things in it, the body is just free-form open-fire zone of content. But there is more to it than this. The body should have some structure to it. That means a 'header', a 'main' and a 'footer'. In the 'header' you are going to want a 'nav' and the same for the 'footer', you are going to want a 'nav'. Even if the links are to your social media sites there is still something to go in the respective areas. Then when it comes to your 'main' content, if you believe in structure, you are wanting to have 'article' or 'section' with a possible 'aside' or two. Then there are images. Images don't have to be in random 'div' elements. They should be in 'figure' or 'picture' elements. Anyone who is not writing HTML this way, using the structural elements and structuring their document might as well just be writing in .txt format or posting jpgs of their pages to the internet. You have got to be organised. Ignorance of the HTML elements is not helpful, knowing them is. They shape how you think and how you organise your code. A default stylesheet for people that write this way - structured - could have many useful touches. So CSS grid for the 'header'/'main'/'footer' could include the best way to ensure a sticky footer with the row definitions and align-self: end for the footer bit. Images in picture/figure elements could be set to be done properly, if in a containing 'figure' then set to 100% width. If the main has a 'grid' setup then you could easily have well structured HTML show neatly with anything 'not structured' evident because it wouldn't be fitting in the boxes. Document outline is important and a basic stylesheet needs to do badly at styling things that are not going to outline well. So the headings styles should only apply to headings that are in 'article', 'section' or 'aside' blocks. There is also a small matter of pixels. When was the last time a pixel meant anything? 2007? Nowadays pixels are virtual. So it really has to be em/rems and viewer units all the way. The pixel is outmoded. For your forms you want to think differently and more structured. So 'form' needs to be 'display: grid' and then your labels be column 1 with inputs on column 2. Then have a css variable in the responsive media query to set the inputs to column 1 if on mobile. Done this way you can get rid of the hacky margins and paddings on the buttons and just use 'grid gap'. This means forms can then be a straight list of label/input pairs in well organised structured code that looks fantastic and is fully mobile out the box. As it is the stylesheet is a good idea but it does not really bring any benefits to structured documents in the post-pixel world where CSS grid does all the heavy lifting of simple layout tasks.
Yes that is what I like to see - no classes! So long as one structures the content then it looks good. Or at least not 'unstyled'.
Tacit is behind the times when it comes to CSS Grid, I don't see the point in jiggling with floats, again it is one of those things that constrains how you think. With CSS Grid you can write content in a natural order and then position blocks of it according to design and, with a few CSS variables get it working in all viewports. Interesting that tacit does not show default styles with structural elements. Maybe the HTML5 spec has been worked through rather than the starting point assumed to be structured content. I can remember the days of Microsoft Word when some people would use templates and styles. Some people just did not get it and would make a title a title by hitting the 'bold' button and pushing the font size up, maybe using blank lines for spacing. I feel that the web is full of people who never understood styles in Word and didn't have a clue as to why you might need them.
What could have been good feedback is ruined by tone. This is someone who has in good faith decided to show the HN community. The fact that he's 13 doesn't even really enter into it.
Here is someone who has created something new and has come to share and the first thing you say is:
> I would like to see a version for those of us that structure our documents.
> What is this structure you speak of?
Let's try:
--- I love what you've done. I know that this is still new but I would really love to see some additional support for more structured documents.
I will try, if time allows, to create a pull request for these features. ---
In fact tips like yours are what is most useful to learn for me from here. However, in primary school I learned a little bit about content sectioning. Stories had to have a beginning, a middle and an end. Titles were important too. These concepts of 'header', 'main' and 'footer' with 'sections' are not a million miles away from how writing was taught in the olden days to primary school kids. Just because the grown ups can't be bothered to structure their HTML as per the spec with these logical groupings I don't see why 13 year olds should get a free pass. I don't want the web to be stuck in a sea of div tags styled with floats forever.
Thanks for the feedback, although I would like to make the point: Water.css does style structured websites and doesn't involve any floats or div tags anywhere. If not for semantic html Water.css wouldn't work at all because that's what enables the classless approach.
And I'm purposely not including support for navbars and such as this is meant more for article pages and tiny demos and the sorts. If you're interested in adding a footer, though, I'm accepting PRs :)
This seems like an orthogonal complaint. For example, on my website, I make an effort to use semantic HTML elements–but that doesn't mean I couldn't drop in a CSS file that styled text and added margins like this one. I don't quite understand how this has anything to do with this framework.
You're not getting the love here, though I agree with most of this.
Sadly, HTML5 offers virtually all of this out of the box, but it's not seen or understood by most. Mark Pilgrim's Dive Into HTML5 is itself mostly a demonstration of this (it lacks article and section tags, though is otherwise lean), and the page source itsel is very highly readable: view-source:https://diveintohtml5.info/introduction.html https://diveintohtml5.info/introduction.html There are also notions such as microformats and standard templates, which smoth the way to standard and substitutable stylesheets as well as parsing, search, bibliographic, and archival tools. http://microformats.org/wiki/get-started All of which start from document structure.
I am finding that it is female developers who are on the conference circuit explaining how we have been doing it wrong and how we can do it right. I did the view source and I won't be adding him to my list of 'HTML5 gurus' just yet, even though times change and his work may be better now.
Same as my previous comment, no 'main' or 'nav' or all that stuff. There are these microformat things which are okay if you want to get your product info or book into Google in an sku/price/ISBN type of schema. But we conflate that with weird 'aria' accessibility things. Properly structured HTML just does that out the box. So why use 'main'? Well, if you do reader mode in Firefox or Safari then it cuts the cruft out and just shows you the stuff you want to read. Or that you want others to read. It is not rocket science and you don't need any Wordpress style 'skip to main content' link hidden at the top or 'role=main', just the 'main' element will do. But who knows that? Everyone in the game should. I checked the Apple site for HTML recently and they sell billions from that site. But none of the links in the footer are in a 'nav' element. I know people don't care and that I am the only person in the world that has noticed their 'poor HTML' but you would think they would be able to get that bit of structure right. Their site is pretty awesome, they have 'main' done but didn't do very well with the navigation links. I am not being a pedant for thinking that is odd but for people who only care about the latest frameworks and 'technologies' content is just data not something that needs to be structured. I don't care about 'technologies', to me content has to be structured right if it is to be taken seriously. What I also find odd is that structure and HTML5 elements are easy. There are vastly less elements than there are random Bootstrap classes but nobody cares to learn the elements.
Apple has the footer links in a footer tag with role=contentinfo, which is somewhat appropriate (The role=contentinfo is somewhat unnecessary, since a top-level footer already implies it, but it doesn't hurt). Not all navigation has to be in a nav tag. To quote the HTML spec:
> Not all groups of links on a page need to be in a nav element — the element is primarily intended for sections that consist of major navigation blocks. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases; while a nav element can be used in such cases, it is usually unnecessary. You can argue that what Apple has here is comprehensive enough to warrant being called out as a navigation, especially since the structure there doesn't appear to be immediately accessible from other page sections, but it's not clear cut, and it's likely a predictable pattern for a user of assistive technologies that company homepages have such footers.
Comments (104) 27 threads
Earlier commentsWhat is this structure you speak of?
Most people assume HTML has a 'head' and a 'body'. The head has script and tag things in it, the body is just free-form open-fire zone of content.
But there is more to it than this.
The body should have some structure to it. That means a 'header', a 'main' and a 'footer'. In the 'header' you are going to want a 'nav' and the same for the 'footer', you are going to want a 'nav'. Even if the links are to your social media sites there is still something to go in the respective areas.
Then when it comes to your 'main' content, if you believe in structure, you are wanting to have 'article' or 'section' with a possible 'aside' or two.
Then there are images. Images don't have to be in random 'div' elements. They should be in 'figure' or 'picture' elements.
Anyone who is not writing HTML this way, using the structural elements and structuring their document might as well just be writing in .txt format or posting jpgs of their pages to the internet. You have got to be organised. Ignorance of the HTML elements is not helpful, knowing them is. They shape how you think and how you organise your code.
A default stylesheet for people that write this way - structured - could have many useful touches. So CSS grid for the 'header'/'main'/'footer' could include the best way to ensure a sticky footer with the row definitions and align-self: end for the footer bit.
Images in picture/figure elements could be set to be done properly, if in a containing 'figure' then set to 100% width. If the main has a 'grid' setup then you could easily have well structured HTML show neatly with anything 'not structured' evident because it wouldn't be fitting in the boxes.
Document outline is important and a basic stylesheet needs to do badly at styling things that are not going to outline well. So the headings styles should only apply to headings that are in 'article', 'section' or 'aside' blocks.
There is also a small matter of pixels. When was the last time a pixel meant anything? 2007? Nowadays pixels are virtual. So it really has to be em/rems and viewer units all the way. The pixel is outmoded.
For your forms you want to think differently and more structured. So 'form' needs to be 'display: grid' and then your labels be column 1 with inputs on column 2. Then have a css variable in the responsive media query to set the inputs to column 1 if on mobile. Done this way you can get rid of the hacky margins and paddings on the buttons and just use 'grid gap'.
This means forms can then be a straight list of label/input pairs in well organised structured code that looks fantastic and is fully mobile out the box.
As it is the stylesheet is a good idea but it does not really bring any benefits to structured documents in the post-pixel world where CSS grid does all the heavy lifting of simple layout tasks.
https://yegor256.github.io/tacit/
Tacit is behind the times when it comes to CSS Grid, I don't see the point in jiggling with floats, again it is one of those things that constrains how you think. With CSS Grid you can write content in a natural order and then position blocks of it according to design and, with a few CSS variables get it working in all viewports.
Interesting that tacit does not show default styles with structural elements. Maybe the HTML5 spec has been worked through rather than the starting point assumed to be structured content.
I can remember the days of Microsoft Word when some people would use templates and styles. Some people just did not get it and would make a title a title by hitting the 'bold' button and pushing the font size up, maybe using blank lines for spacing. I feel that the web is full of people who never understood styles in Word and didn't have a clue as to why you might need them.
Here is someone who has created something new and has come to share and the first thing you say is:
Let's try:---
I love what you've done. I know that this is still new but I would really love to see some additional support for more structured documents.
I will try, if time allows, to create a pull request for these features.
---
In fact tips like yours are what is most useful to learn for me from here.
However, in primary school I learned a little bit about content sectioning. Stories had to have a beginning, a middle and an end. Titles were important too.
These concepts of 'header', 'main' and 'footer' with 'sections' are not a million miles away from how writing was taught in the olden days to primary school kids.
Just because the grown ups can't be bothered to structure their HTML as per the spec with these logical groupings I don't see why 13 year olds should get a free pass. I don't want the web to be stuck in a sea of div tags styled with floats forever.
And I'm purposely not including support for navbars and such as this is meant more for article pages and tiny demos and the sorts. If you're interested in adding a footer, though, I'm accepting PRs :)
Continue this thread — 1 reply
Sadly, HTML5 offers virtually all of this out of the box, but it's not seen or understood by most. Mark Pilgrim's Dive Into HTML5 is itself mostly a demonstration of this (it lacks article and section tags, though is otherwise lean), and the page source itsel is very highly readable:
view-source:https://diveintohtml5.info/introduction.html
https://diveintohtml5.info/introduction.html
There are also notions such as microformats and standard templates, which smoth the way to standard and substitutable stylesheets as well as parsing, search, bibliographic, and archival tools.
http://microformats.org/wiki/get-started
All of which start from document structure.
Same as my previous comment, no 'main' or 'nav' or all that stuff. There are these microformat things which are okay if you want to get your product info or book into Google in an sku/price/ISBN type of schema. But we conflate that with weird 'aria' accessibility things. Properly structured HTML just does that out the box.
So why use 'main'? Well, if you do reader mode in Firefox or Safari then it cuts the cruft out and just shows you the stuff you want to read. Or that you want others to read. It is not rocket science and you don't need any Wordpress style 'skip to main content' link hidden at the top or 'role=main', just the 'main' element will do.
But who knows that?
Everyone in the game should.
I checked the Apple site for HTML recently and they sell billions from that site. But none of the links in the footer are in a 'nav' element. I know people don't care and that I am the only person in the world that has noticed their 'poor HTML' but you would think they would be able to get that bit of structure right. Their site is pretty awesome, they have 'main' done but didn't do very well with the navigation links. I am not being a pedant for thinking that is odd but for people who only care about the latest frameworks and 'technologies' content is just data not something that needs to be structured. I don't care about 'technologies', to me content has to be structured right if it is to be taken seriously.
What I also find odd is that structure and HTML5 elements are easy. There are vastly less elements than there are random Bootstrap classes but nobody cares to learn the elements.
> Not all groups of links on a page need to be in a nav element — the element is primarily intended for sections that consist of major navigation blocks. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases; while a nav element can be used in such cases, it is usually unnecessary.
You can argue that what Apple has here is comprehensive enough to warrant being called out as a navigation, especially since the structure there doesn't appear to be immediately accessible from other page sections, but it's not clear cut, and it's likely a predictable pattern for a user of assistive technologies that company homepages have such footers.
Continue this thread — 1 reply
All comments shown.
Couldn't load more comments. Check your connection and try again.