The placeholder attribute instead of the label element
Please, stop using the placeholder attribute instead of the label element. People...
For further actions, you may consider blocking this person and/or reporting abuse
Nice, some good points. This is really short-sighted though: "Using display: block and position: absolute (fixed) together". In all browsers? In one browser? What if a user agent is configured differently? Chrome makes changes to their user agent stylesheet all the time. I would never discourage someone to leave out something as important as a display property if they want to explicitly define it. Sure, there are some we've all gotten used to over the years, but by no means would I consider this a "mistake". What if said element is a table and said user wants to absolutely position it as a block element? Be careful with how you are categorizing these as "mistakes".
I have not thought about this before. So I checked it with a CodePen and found this sentence in the Specification:
I assume that these words about "new containing block" force browser developers to display absolutely positioned pseudo-element as a
block
.No they don't.
display:inline-block
,display:table-cell
anddisplay:list-item
all establish containing blocks, so any of those would also be consistent with that sentence from the spec. What you are looking for is section 9.7 Relationships between 'display', 'position', and 'float', step 2In Chrome. IE, Edge, Firefox, Safari, Android, Safari on iOS, UC Browser, Samsung
Any mistakes authors when writing headlines?
Only can judge him.
(It's all love;))
Although I agree with most of the points, I find the headline a bit misleading - are these the "most common mistakes"? I must confess, I've never seen the "resize:none" - setting somewhere in the wild for textareas but honestly, I've also not payed attention to that :).
I definitely agree with the misusage of the placeholder - that also goes for UI designers, who misuse the placeholder already.
Relating to the usage of label, I'd recommend to extend the example with an id for the input-field and a relating for-attribute for the label-tag.
<label for="email_field">
Email:<input type="email" id="email_field" />
</label>
That makes it more relateable where the label tag relates to :).
Wouldn't it be nicer to wrap icons in figure elements and with a figcaption to help users with screenreaders?
This depends on a case
can you elaborate ?
Cool! :)
Did you count how many famous boilerplate templates have the "bad practice" hamburger menu? 🤣🤣
Awesome Article!
I've lost count
That moment when i realized i did all of that mistakes...
Don't worry. Now you know more and can fix it!
Nice one, good job mr Stas.
Thank you!
Nice article! Helpful :)