New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move "rel" attribute to end of tag #80
Conversation
in my opinion, while that may be a best practice, it makes the readability of this resource more difficult. It's the rel that is the primary defining attribute about what sort of link this is. Moving them to the end, after varied href lengths, places the wrong emphasis, as hrefs are mostly arbitrary for these examples. I do however think it would be a good idea to add a note / section that calls out best practice for actual implementation of these elements, and their attribute order. |
@marcobiedermann while I appreciate the contribution, I have to agree with @scottaohara on this one. Any chance you'd be willing to create a note / section for this? |
Opened #98 to address this issue. Thanks guys! |
Can anyone explain why the placement of the |
GZIP tries to find same pattern in a text which gets compressed by referencing them instead of duplicating them. Take a look at this video: https://www.youtube.com/watch?v=SWBkneyTyPU By moving the The best way to minify your code is to sort all your HTML attributes and CSS properties in the same order. Most of the time, alphabetical order will work the best. I hope, I could clear some things up :) |
I think this is not the task of a programmer, this should be the task of the minfier (uglyjs, etc). |
a debate over who / what should be doing this isn't really relevant to the fact that this is a good practice to follow, and people should be aware of it, so that if they aren't or can't use one of those tools, they can still follow a best practice. |
Of course they can, but it's essentially the same as "programmers need to name their variables a,b,c,etc. because that saves space". |
Moving the
rel
attribute to the end saves a few bytes when using gzip compression.In this example it does only matter 2 bytes but this will increase when used in a real world website.
Because
href
does occur more often thanrel
, e. g. ina
tags this will reduce the overall filesize.I know this does not seem like a lot, but in my opinion it is a best practice.
Also Google uses this pattern: