form.css 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /**
  2. * CSS styles for forms generated by yiic.
  3. *
  4. * The styles can be applied to the following form structure:
  5. *
  6. * <div class="form">
  7. * <div class="row">
  8. * <label for="inputid">xyz</label>
  9. * <input name="inputid" id="inputid" type="text" />
  10. * <p class="hint">hint text</p>
  11. * </div>
  12. * <div class="row">
  13. * <label for="inputid">xyz</label>
  14. * <input name="inputid" id="inputid" type="text" />
  15. * <p class="hint">hint text</p>
  16. * </div>
  17. * <div class="row buttons">
  18. * <label for="inputid">xyz</label>
  19. * <input name="inputid" id="inputid" type="text" />
  20. * <p class="hint">hint text</p>
  21. * </div>
  22. * </div>
  23. *
  24. * The above code will render the labels and input fields in separate lines.
  25. * In order to render them in the same line, please use the "wide" form as follows,
  26. *
  27. * <div class="wide form">
  28. * ......
  29. * </div>
  30. *
  31. * @author Qiang Xue <qiang.xue@gmail.com>
  32. * @link http://www.yiiframework.com/
  33. * @copyright 2008-2010 Yii Software LLC
  34. * @license http://www.yiiframework.com/license/
  35. */
  36. div.form
  37. {
  38. margin: 0;
  39. }
  40. div.form input,
  41. div.form textarea,
  42. div.form select
  43. {
  44. margin: 0.2em 0 0.5em 0;
  45. }
  46. div.form fieldset
  47. {
  48. border: 1px solid #DDD;
  49. padding: 10px;
  50. margin: 0 0 10px 0;
  51. -moz-border-radius:7px;
  52. }
  53. div.form label
  54. {
  55. font-weight: bold;
  56. font-size: 0.9em;
  57. display: block;
  58. }
  59. div.form .row
  60. {
  61. margin: 5px 0;
  62. }
  63. div.form .hint
  64. {
  65. margin: 0;
  66. padding: 0;
  67. color: #999;
  68. }
  69. div.form .note
  70. {
  71. font-style: italic;
  72. }
  73. div.form span.required
  74. {
  75. color: red;
  76. }
  77. div.form div.error label,
  78. div.form label.error,
  79. div.form span.error
  80. {
  81. color: #C00;
  82. }
  83. div.form div.error input,
  84. div.form div.error textarea,
  85. div.form div.error select,
  86. div.form input.error,
  87. div.form textarea.error,
  88. div.form select.error
  89. {
  90. background: #FEE;
  91. border-color: #C00;
  92. }
  93. div.form div.success input,
  94. div.form div.success textarea,
  95. div.form div.success select,
  96. div.form input.success,
  97. div.form textarea.success,
  98. div.form select.success
  99. {
  100. background: #E6EFC2;
  101. border-color: #C6D880;
  102. }
  103. div.form .errorSummary
  104. {
  105. border: 2px solid #C00;
  106. padding: 7px 7px 12px 7px;
  107. margin: 0 0 20px 0;
  108. background: #FEE;
  109. font-size: 0.9em;
  110. }
  111. div.form .errorMessage
  112. {
  113. color: red;
  114. font-size: 0.9em;
  115. }
  116. div.form .errorSummary p
  117. {
  118. margin: 0;
  119. padding: 5px;
  120. }
  121. div.form .errorSummary ul
  122. {
  123. margin: 0;
  124. padding: 0 0 0 20px;
  125. }
  126. div.wide form label
  127. {
  128. float: left;
  129. margin-right: 10px;
  130. position: relative;
  131. text-align: right;
  132. width: 100px;
  133. }
  134. div.wide form .row
  135. {
  136. clear: left;
  137. }
  138. div.wide form .buttons
  139. {
  140. clear: left;
  141. padding-left: 110px;
  142. }
  143. div.wide form .errorMessage
  144. {
  145. margin: 0 0 0 110px;
  146. }