Jump to content

Width Issue (alternative To Label)


son
 Share

Recommended Posts

I have a form the update colours in database. The relevant extract is:

<h2>Update and delete colours</h2><form action="colours.php" method="post" style="float:left; margin-right:5px;"><input type="hidden" name="id" value="22" /> <label for="colour">brown</label> <input type="text" name="colour" id="colour" size="20" maxlength="10" > <input type="hidden" name="submitted" value="TRUE" /><input type="hidden" name="mode" value="upd" /><input type="submit" name="submit" value="Update" /></form><form action="colours.php" method="post"><input type="hidden" name="id" value="22" /><input type="hidden" name="colour" id="colour" value="brown"> <input type="hidden" name="submitted" value="TRUE" /><input type="hidden" name="mode" value="del" /><input type="submit" name="submit" value="Delete" /></form><br clear="left" />

Label, input field, update and delete button sitting nicely next to each other, but if the label fields have different widths it all does not look so neat. Cannot assign a width to label tag and this also would not work with a span. What else can you do?Son

Link to comment
Share on other sites

i'm not sure what you are asking?Do you want various <label> tags and just one time the two buttons?Or every label has two buttons next to it and the buttons have to be under eachother?

Link to comment
Share on other sites

i'm not sure what you are asking?Do you want various <label> tags and just one time the two buttons?Or every label has two buttons next to it and the buttons have to be under eachother?
I want mainly to have everything for one item in one line (so you can update and delete in same line as such). Saves space...Son
Link to comment
Share on other sites

Make the labels and inputs display:block and float:left - that way they will still be next to each other and can also have defined widths.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...