Dec 9, 2005 #1 ASPVBNerd Programmer Joined Nov 23, 2005 Messages 83 Location SE If you look at this link you will see that the inputs are not at the same line. http://g.1asphost.com/testare/javascript.asp?page=kontakt How can i make that the inputs are at the same line with css
If you look at this link you will see that the inputs are not at the same line. http://g.1asphost.com/testare/javascript.asp?page=kontakt How can i make that the inputs are at the same line with css
Dec 9, 2005 #2 BillyRayPreachersSon Programmer Joined Dec 8, 2003 Messages 17,047 Location GB Unless you want to use tables, I'd go with floating each element to the left to do this. Then, just clear left on each of the labels. If you want to avoid a nasty bug in NN7.0 where styled labels don't show, then put a span around then, and float that instead. Then give it a width. Hope this helps, Dan [tt]Dan's Page [blue]@[/blue] Code Couch http://www.codecouch.com/dan/[/tt] Upvote 0 Downvote
Unless you want to use tables, I'd go with floating each element to the left to do this. Then, just clear left on each of the labels. If you want to avoid a nasty bug in NN7.0 where styled labels don't show, then put a span around then, and float that instead. Then give it a width. Hope this helps, Dan [tt]Dan's Page [blue]@[/blue] Code Couch http://www.codecouch.com/dan/[/tt]
Dec 9, 2005 Thread starter #3 ASPVBNerd Programmer Joined Nov 23, 2005 Messages 83 Location SE Dan, could you give me a example how i should do it. Upvote 0 Downvote
Dec 9, 2005 #4 BillyRayPreachersSon Programmer Joined Dec 8, 2003 Messages 17,047 Location GB Here's something that should help you get started with this. This CSS: Code: <style type="text/css"> .inputRow { clear: left; } .inputRowLabel { width: 10em; float: left; } .inputRowField { width: 10em; float: left; } </style> with this HTML: Code: <div class="inputRow"> <span class="inputRowLabel"> <label for="someField">This is field 1</label> </span> <span class="inputRowField"> <input type="text" id="someField" /> </span> </div> works fine for me with an XHTML 1.1 DOCTYPE. Hope this helps, Dan [tt]Dan's Page [blue]@[/blue] Code Couch http://www.codecouch.com/dan/[/tt] Upvote 0 Downvote
Here's something that should help you get started with this. This CSS: Code: <style type="text/css"> .inputRow { clear: left; } .inputRowLabel { width: 10em; float: left; } .inputRowField { width: 10em; float: left; } </style> with this HTML: Code: <div class="inputRow"> <span class="inputRowLabel"> <label for="someField">This is field 1</label> </span> <span class="inputRowField"> <input type="text" id="someField" /> </span> </div> works fine for me with an XHTML 1.1 DOCTYPE. Hope this helps, Dan [tt]Dan's Page [blue]@[/blue] Code Couch http://www.codecouch.com/dan/[/tt]
Dec 9, 2005 Thread starter #5 ASPVBNerd Programmer Joined Nov 23, 2005 Messages 83 Location SE This is perfect. Thanks for the help Dan. Upvote 0 Downvote