Destramic Posted May 15, 2010 Share Posted May 15, 2010 hey guys im trying to get multiple checkboxes on a line without the label dropping down on another line...if anyone can help please css label { width: 100px; float:left; display: inline;} input[type="checkbox"] { padding:6px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } html <label for="Neatherlands">Neatherlands</label> <input type="checkbox" name="neatherlands" id="Neatherlands" value="" /> <label for="United Kingdom">United Kingdom</label> <input type="checkbox" name="united kingdom" id="United Kingdom" value="" /> Quote Link to comment Share on other sites More sharing options...
haku Posted May 15, 2010 Share Posted May 15, 2010 label, input { float:left; } You will have to make some adjustments to this - notably as this will affect all inputs, not just checkboxes, but this is the core idea of how it works. Quote Link to comment Share on other sites More sharing options...
Destramic Posted May 15, 2010 Author Share Posted May 15, 2010 thanks for your reply...i just tried the float and it just puts both labels and checkboxes on different columns and not the same one...any other ideas? Quote Link to comment Share on other sites More sharing options...
haku Posted May 15, 2010 Share Posted May 15, 2010 Then you have a conflict somewhere else, because the code I gave you will do what you want (assuming you want label -> checkbox -> label -> checkbox all on one line). Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted May 15, 2010 Share Posted May 15, 2010 Has a table method not occured to you? <table> <tr> <td> <label for="Neatherlands">Neatherlands</label> <input type="checkbox" name="neatherlands" id="Neatherlands" value="" /> </td> <td> <label for="United Kingdom">United Kingdom</label> <input type="checkbox" name="united kingdom" id="United Kingdom" value="" /> </td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
haku Posted May 16, 2010 Share Posted May 16, 2010 Tables should only be used for tabular data - which this is not. Though it will probably work. Quote Link to comment Share on other sites More sharing options...
Destramic Posted May 16, 2010 Author Share Posted May 16, 2010 thanks haku...after a bit of playing around i found out the problem...thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.