Posted By

kaartz on 07/01/10


Tagged

css jquery


Versions (?)

Justify Elements Using jQuery and CSS


 / Published in: JavaScript
 

URL: http://www.jankoatwarpspeed.com/post/2008/07/09/Justify-elements-using-jQuery-and-CSS.aspx

  1. $(document).ready(function() {
  2. var max = 0;
  3. $("label").each(function(){
  4. if ($(this).width() > max)
  5. max = $(this).width();
  6. });
  7. $("label").width(max);
  8. });
  9.  
  10. //CSS
  11. label, input[type="text"]{
  12. float:left;
  13. display:block;
  14. }
  15. label
  16. {
  17. margin-right: 5px;
  18. }
  19. .field{
  20. width:100%;
  21. overflow:auto;
  22. margin:5px 0px;
  23. }

Report this snippet  

You need to login to post a comment.