Are there tags in the field that have any advantages?

I know that in order for web pages to be accessible to people with low or low vision, many HTML functions are necessary so that special browsers can read aloud the text for them.

For this to work correctly, you must make sure that you follow good HTML coding standards, for example. you must make sure that your images have alternative text, that you are not using tables for layout, etc.

But I'm not sure if the fieldset element groups input fields. Is the fieldset tag any special accessibility or are they used solely for layout?

+6
html
source share
2 answers

Yes. See: http://www.alistapart.com/articles/prettyaccessibleforms/

Some screen readers will even read the legend for each label in a set of fields.

<fieldset> <legend>What is your favorite animal?</legend> <input type="radio" name="animal" id="Cat" /> <label for="Cat">Cat</label> <input type="radio" name="animal" id="Dog" checked="checked" /> <label for="Dog">Dog</label> <input type="radio" name="animal" id="Rabbit" /> <label for="Rabbit">Rabbit</label> </fieldset> 
  • Your favorite animal Switch. Cat. Not chosen.
  • Your favorite animal Switch. Dog. Selected
  • Your favorite animal Switch. Rabbit. Not chosen.
+4
source share

Short answer: Yes. Structure and semantics are good.

For example.

Many screen devices have a β€œform mode” in which they ignore everything that is not related to the form.

 () Cat () Dog () Rabbit 

It is pretty pointless

 <fieldset> <legend>What is your favourite animal?</legend> () Cat () Dog () Rabbit </fieldset> 

Now the field set legend gives it context.

The paragraph will not work - it will not be presented to the user in the form mode. The label will not work - it describes the field, not a set of them. You would use a label for each of the cats, dogs, and rabbits.

+10
source share

All Articles