Why does font-size only work when I set background-color on a button?
Posted
by
Andrew Latham
on Stack Overflow
See other posts from Stack Overflow
or by Andrew Latham
Published on 2012-09-27T02:21:03Z
Indexed on
2012/09/27
3:37 UTC
Read the original article
Hit count: 326
css
|ruby-on-rails
I am in Rails 3.2.6, on Chrome.
I have the following code in my html.erb file:
<div id="beta">
<%= form_tag({}, {:id => "id_search"}) do %>
ID: <%= text_field_tag "beta_id" %>
<%= submit_tag "Go" %>
<% end %>
</div>
When I set the font-size to 24pt in my CSS file, the text field changes properly, but the button doesn't change at all. I pulled it up in my Developer Tools, and it was getting the CSS property, but just not changing its font size. Even when I put !important
, nothing happened. I couldn't change the font-family either.
JSFiddle: http://jsfiddle.net/R5CXg/
Changing other properties worked. When I changed the background-color
property, the button suddenly turned square instead of round, and popped into the correct font-size and font-family.
Why was this the case and how can I work around it?
© Stack Overflow or respective owner