learning-area icon indicating copy to clipboard operation
learning-area copied to clipboard

Обертка для лейбл+инпут

Open pecourses opened this issue 3 years ago • 1 comments

https://github.com/mdn/learning-area/blob/ce63adeaaa67514291e9da11671d735f99195b2a/html/forms/html-form-structure/payment-form.html#L19

  • чаще оберткой над лейбл+инпут делают div или p, списки чаще используют для input type="checkbox" или "radio", что логично, т.к. запрашиваемая в инпутах инфа не всегда однотипна, а в списки помещают однотипную инфу. (Хотя в примерах можно встрерить и списки)

pecourses avatar Jun 23 '21 17:06 pecourses

DeepL translation:

More often div or p are used as wrapper over label+input, lists are more often used for input type="checkbox" or "radio", which is logical, because requested info in inputs is not always the same, and lists are used to put the same info. (Although you may see lists in the examples.)

I don't see a problem with using lists to structure forms. You can look at a form as a list of information we request from someone. When looking at the HTML spec (4.4.6 The ul element and 4.4.8 The li element) I can't see anything contradicting this usage.

mikoMK avatar Aug 15 '21 09:08 mikoMK