I am new to ruby on rails platform. I am designing a form with text fields. In the beginning, I created a simple html file with css to align the text fields. Below is my css
#input{
padding-left:50px;
padding-bottom:30px;
}
I created text fields using following code:
<div id = "input"><input type = "text" size = "25" name = "fname" value = "first name"></input></div>
<div id = "input"><input type = "text" size = "25" name = "lname" value = "last name"></input></div>
When I ran the web page, I saw the text field aligned properly the way I wanted inside form. However I tried to convert the code in RoR, I am not able to see padding. Below is my code in RoR
<div class="input"><%= f.text_field :fname, :size => 25, :placeholder => 'first name' %></div>
<div class="input"><%= f.text_field :lname, :size => 25, :placeholder => 'last name' %></div>
Can anyone tell me what might be the issue with my approach?
In the css code
#input{..}the hash#means that it is looking for an id. After you have changed the code, you set it toclass="input". Therefore the css can’t find it by id. Change the css to.input{..}.