How to switch from table to div for FORM layout?

前端 未结 5 1064
栀梦
栀梦 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 16:14

    Consider this article titled Tableless forms using CSS from CssDrive.

    A little bit of style really helps. I've been refactoring/replacing all my table'd forms with the pattern found in the article above.

    With the following code:

    • asp:textbox works perfectly, needs no modification for all kinds of textboxes
    • asp:button works perfectly, needs no modification
    • asp:checkbox would likely need modification, perhaps wrapped in another div with a special style

    http://imgur.com/SYtAG.png

    Here's the basic example presented:

    The CSS:

    
    

    The HTML:





提交回复
热议问题