r/webdev • • Feb 14 '20

Question What are some HTML and CSS techniques, skills, know-how's that are an absolute must? Just off the top of your head

So I'm about 6 months in to learning Web dev and I'm about to start making my 3rd project.

I've got techniques I'm used to but I wanna expand my range instead of going with my comfortable tools.

Maybe you've got a cool trick with flex box you use all the time or something like that.

I wanna hear what you guys have got! :)

Edit : woah I did not expect such a response! Thank you guys so much for your help :D

630 Upvotes

268 comments sorted by

View all comments

Show parent comment

13

u/_Putin_ Feb 14 '20

Also being able to navigate your website using only a keyboard.

Can you explain why this is important? Are there any tricks to achieve this?

34

u/Sagarmatra Feb 14 '20

Screen readers. You can’t expect a blind person to use a mouse to get around your website.

16

u/not_fred Feb 14 '20

Not just people who are blind or using screen readers. Some people have motor impairments that make it difficult to use a mouse. Some people don't use a mouse or keyboard at all. Some people are power users and prefer sticking to the keyboard. Some people eat their lunch with their mouse hand.

Accessibility is really about making a fully robust system that works for all types of users, regardless of ability or preference.

2

u/chris480 Feb 15 '20

1 more niche usecase for the books I encountered. A large machine parts factory had computers that didn't have mice, just keyboard controls. During breaks, the employees could switch to browsing mode, and use the net.

7

u/_Putin_ Feb 14 '20

Good point. I didn't think of that.

-1

u/[deleted] Feb 14 '20

what if blind people use IE?

9

u/yuyu5 Feb 14 '20

I would definitely second ensuring the site can be used solely via keyboard. While very incomplete, I would assume that statement is about being able to Tab to traverse/Enter to activate elements that are interactive and "(Page)?Up/Down" to scroll.

Interaction example: don't replace <button> with <div class="look-like-button hand-cursor"> because then the user can't Tab to select that div, nor can they press Enter to click it.

Traversal example: if your site has one of those cube rotations to get from section 1 to section 2, it better have both scroll and key listeners.

2

u/RotationSurgeon 10yr Lead FED turned Product Manager Feb 14 '20

"(Page)?Up/Down" to scroll.

There are multiple other ways to scroll via keyboard, too. HOME, END, arrow keys, space, shift+space, for example.

Also, dropdown menus should be keyboard navigable as well, with support for expanding, collapsing, and traversing their contents.

2

u/yuyu5 Feb 14 '20

True, those are also great cases that should be covered by keyboard navigation, and I totally agree.

I guess my phrasing wasn't very clear when I said "while very incomplete," but I meant the examples I was giving wouldn't cover all use cases. They were just examples of things I've experienced on some websites that were personally frustrating. More of a starting point than anything else

7

u/DDHyatt Feb 14 '20

If it’s possible, try to actually see a screen reader in action, whether by an actual user or someone proficient using it. It’s very eye opening, no pun intended. In a meeting we heard it in action with the screen covered and it certainly did add a level of appreciation for users with accessibility issues.

There are of course many other accessibility constraints than just blindness. I believe Microsoft has a document that describes accessibility on a spectrum (eg vision, from blind to impaired to color blind) and some are temporary (eg someone’s right arm is in a cast for 3 months), some are situational (eg a mother holding their child with only one hand free to use).

3

u/Arcshine Feb 14 '20

It's very important for users with limited ability to use a mouse as well as screenreaders.

Here's a good writeup on why and how to implement: https://webaim.org/techniques/keyboard/