2013-06-12 20 views
0

有些東西我不明白 我不明白爲什麼我有height:42px而不是height:395px在form_for中寫html語法

當我顯示出與螢火蟲的代碼,我看到

<form id="new_user" class="wizard" style="height: 42px;" method="post" action="/users" accept-charset="UTF-8"> 

但在我看來,我有這個

<div class="contentbox"> 
    <div id="wizard", style="left: 0px; position: relative;"> 
     <div class="container_12 clearfix leading"> 
      <div class="grid12"> 

    <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html=> { :class => "wizard",:style => 'height: 395px' }) do |f| %> 
    <%= devise_error_messages! %> 


         <!-- wizard --> 
         <form action="#" class="wizard" novalidate> 
          <nav> 
           <ul class="clearfix"> 
            <li class="active"><strong>1.</strong> Identification</li> 
            <li><strong>2.</strong> Information </li> 
            <li><strong>3.</strong> Finalisation</li> 
           </ul> 
          </nav> 

你有任何想法,爲什麼我得到height:42px而不是height:395px

回答

0

使用樣式表而不是內聯樣式可能會更好,但我認爲這只是一個缺失的問題;

:html=> { :class => "wizard",:style => 'height: 395px;' } 

如果您的樣式表之間的衝突,你也可以把

:html=> { :class => "wizard",:style => 'height: 395px !important;' }