I disagreeI like the approach in the link I provided and I've seen a similar approach in some books, as well. It's a nice way to elegantly create user forms
![]()
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
tables good ... css bad ...
it would be so much nicer if all browsers played the same ...
Quote of the Month:
INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.
Questions to Ponder:
Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?
iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.
Here's a quick example of how I do my forms:
and the CSS:Code:<ul class="input-fields"> <li> <asp:Label ID="Label1" runat="server" AssociatedControlID="TextBox1" Text="Label 1" /> <asp:TextBox ID="TextBox1" runat="server" /> </li> <li> <asp:Label ID="Label2" runat="server" AssociatedControlID="TextBox2" Text="Label2" /> <asp:TextBox ID="TextBox2" runat="server" /> </li> <li> <asp:Label ID="Label3" runat="server" AssociatedControlID="TextBox3" Text="Label3" /> <asp:TextBox ID="TextBox3" runat="server" /> </li> </ul>
Code:ul.input-fields { list-style-position: outside; list-style-type: none; margin: 0; padding: 0; } ul.input-fields li { margin: 0; } ul.input-fields label, ul.input-fields span { display: inline-block; font-weight: bold; width: 10em; } ul.input-fields input, ul.input-fields select, ul.input-fields textarea } margin: 2px 0; }
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
How would you get it to look like this J?
Code:First Name: textbox Last Name: textbox Title: dropdownlist Date of Birth: textbox / textbox / textbox
Something like this:
Code:ul.input-fields { list-style-position: outside; list-style-type: none; margin: 0; padding: 0; text-align: center; } ul.input-fields li { margin: 0; } ul.input-fields label, ul.input-fields span { display: inline-block; font-weight: bold; width: 15em; } ul.input-fields input, ul.input-fields select, ul.input-fields textarea } margin: 2px 0; }
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Would you not need some sort of align left / right in there?
The label is aligned right and the form elements aligned left.
From what you showed me you were looking for, what I have should work. I tested it before posting it.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Oh. OK. I haven't tested it yet as it'll mean re-writing all my pages...![]()
Bookmarks