HTML fieldset legend

来源:互联网 发布:古琴网络教学 编辑:程序博客网 时间:2024/05/27 00:43
  1. .depot-form fieldset {
  2.   background#efe;
  3. }
  4. .depot-form legend {
  5.   color#dfd;
  6.   background#141;
  7.   font-familysans-serif;
  8.   padding0.2em 1em;
  9. }
  10. .depot-form label {
  11.   width5em;
  12.   floatleft;
  13.   text-alignright;
  14.   margin-right0.5em;
  15.   displayblock;
  16. }
  17. .depot-form .submit {
  18.   margin-left5.5em;
  19. }
 
  1. <!--
  2.  ! Excerpted from "Agile Web Development with Rails, 2nd Ed.",
  3.  ! published by The Pragmatic Bookshelf.
  4.  ! Copyrights apply to this code. It may not be used to create training material, 
  5.  ! courses, books, articles, and the like. Contact us if you are in doubt.
  6.  ! We make no guarantees that this code is fit for any purpose. 
  7.  ! Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information.
  8. -->
  9. <div class="depot-form">
  10.   <%= error_messages_for 'user' %>
  11.   <fieldset>
  12.     <legend>Enter User Details</legend>
  13.     <% form_for :user do |form| %>
  14.       <p>
  15.         <label for="user_name">Name:</label>
  16.         <%= form.text_field :name:size => 40 %>
  17.       </p>
  18.       <p>
  19.         <label for="user_password">Password:</label>
  20.         <%= form.password_field :password:size => 40 %>
  21.       </p>
  22.       <p>
  23.         <label for="user_password_confirmation">Confirm:</label>
  24.         <%= form.password_field :password_confirmation:size => 40 %>
  25.       </p>
  26.       <%= submit_tag "Add User":class => "submit" %>
  27.     
  28.     <% end %>  
  29.   </fieldset>
  30. </div>

 

 

原创粉丝点击