How to switch from table to div for FORM layout?

前端 未结 5 1127
栀梦
栀梦 2020-12-23 15:46

I\'m noticing most folks are talking about using DIVs and CSS for label, textbox pairs. How would one convert a table such as:

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-23 15:58

    I've used basically the same idea for creating a tableless form layout. But, I use an unordered list to hold my labels and inputs. For example:

    The CSS styles can be just the same as what pcampbell has used in his example. The only difference for mine would be the addition of a style for the UL such as:

    ul {list-style: none; margin: 0; padding: 0;}
    

提交回复
热议问题