Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][CSS] Rozmieszczeni formularza
Forum PHP.pl > Forum > Przedszkole
Lethys
Witam,

Obecnie staram się dostosować szablon do swoich wymagań ale napotkałem problem z stworzeniem właściwie wyglądającego formularza.

Wygląda to tak:




Chodzi oczywiście o to aby <label> pokazywało się przed polem formularza a nie za nim jak to obecnie jest oraz o przesunięcie przycisku.

Kod html:

  1. <div class="features">
  2. <div class="features-container">
  3. <div id="sliders">
  4. <h3>Szybka rejestracja</h3>
  5. <form method="post" action="rejestracja.php?action=register" id="newsletter">
  6. <ul class="form">
  7. <li><label for="imie">Imię</label><input name="imie" type="text" maxlength="10"/></li>
  8. <li><label for="email">Adres email</label><input name="email" type="text" maxlength="50"/></li>
  9. <li><label for="email">Powtórz email</label><input name="vemail" type="text" maxlength="50" /></li>
  10. <input name="referujacy" type="hidden" value="'.$ref.'" "/><br>
  11. <li><input type="submit" value="Rejestruj" /></li>
  12. </ul>
  13. </form>
  14. </div>
  15. </div>
  16. <ul id="pager"></ul>
  17. </div>



Kod CSS:

  1.  
  2. ul.custom-list {
  3. list-style:none;
  4. margin-bottom:12px;
  5. }
  6. ul.custom-list li {
  7. padding-left: 20px;
  8. background:url('../images/bullet.png') no-repeat 0 8px;
  9. line-height:30px;
  10. }
  11.  
  12. /* Basic Layout */
  13.  
  14. .form {
  15. list-style:none;
  16. list-style-image:none;
  17. margin:0;
  18. padding:0;
  19. }
  20. .form input, .form textarea {
  21. width:300px;
  22. }
  23. .form label {
  24. display:inline-block;
  25. padding-top:2px;
  26. padding-left:2px;
  27. vertical-align:top;
  28. width:100px;
  29.  
  30. }
  31. .features {
  32. width:500px;
  33. float:right;
  34. }
  35. .features-container {
  36. box-shadow:#cecece 0 0 5px;
  37. -moz-box-shadow:#cecece 0 0 5px;
  38. -webkit-box-shadow:#cecece 0 0 5px;
  39. border-radius:10px;
  40. -moz-border-radius:10px;
  41. -webkit-border-radius:10px;
  42. background:#fff;
  43. padding:10px;
  44. line-height:0;
  45. }
  46. #sliders {
  47. width:480px;
  48. height:270px;
  49. overflow:hidden;
  50. }
  51.  
  52. #newsletter {
  53. float:left;
  54. line-height:36px;
  55. }
  56. #newsletter input[type=text] {
  57. float:left;
  58. background:#fff;
  59. width:190px;
  60. border:1px solid #9eb7bc;
  61. height:18px;
  62. padding:5px;
  63. box-shadow:inset #ccc 0 1px 5px;
  64. -moz-box-shadow:inset #ccc 0 1px 5px;
  65. -webkit-box-shadow:inset #ccc 0 1px 5px;
  66. border-radius:4px;
  67. -moz-border-radius:4px;
  68. -webkit-border-radius:4px;
  69. }
  70. #newsletter input[type=submit] {
  71. display:block;
  72. float:left;
  73. width:auto;
  74. height:30px;
  75. border:0;
  76. background:url('../images/submit-gradient.png') repeat-x 0 0 #9eb7bc;
  77. color:#d9d9d9;
  78. text-shadow:0 1px 1px #222;
  79. border-radius:3px;
  80. -moz-border-radius:3px;
  81. -webkit-border-radius:3px;
  82. margin-left:-11px;
  83. }
  84. #newsletter input[type=submit]:hover {
  85. background:url('../images/submit-gradient.png') repeat-x 0 -30px #9eb7bc;
  86. color:#fff;
  87. cursor:pointer;
  88. }
  89. #newsletter input[type=submit]:active {
  90. background:url('../images/submit-gradient.png') repeat-x 0 -60px #9eb7bc;
  91. outline:0;
  92. }
  93. /* Image gallery */
  94.  


Kombinowałem na kilka sposobów ale nie osiągnąłem swojego celu. Jak zrobić poprawnie ten formularz?
prowseed
  1. #newsletter input[type=text] {
  2. float:left;
  3. background:#fff;
  4. width:190px;
  5. border:1px solid #9eb7bc;
  6. height:18px;
  7. padding:5px;
  8. box-shadow:inset #ccc 0 1px 5px;
  9. -moz-box-shadow:inset #ccc 0 1px 5px;
  10. -webkit-box-shadow:inset #ccc 0 1px 5px;
  11. border-radius:4px;
  12. -moz-border-radius:4px;
  13. -webkit-border-radius:4px;
  14. }


To znaczy na jakie sposoby kombinowales? Bo mi sie wydaje, ze na zadne. Dla tego co powyzej daj display:inline-block; i wykresl float:left;
A przesuniecie przycisku, czyli co? Margin-left ?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.