Alex Zakruzhetskyi
Alex Zakruzhetskyi

Reputation: 1433

Changing size in image_submit_tag

Is it possible to change size in image_submit_tag? Just <%= image_submit_tag ('search.png', size: "40x40")%> doesn't work for me. Thanks ahead.

Upvotes: 2

Views: 531

Answers (1)

Bryan Oemar
Bryan Oemar

Reputation: 926

Give it a css class and do it with CSS.

For example:

<%= image_submit_tag('search.png', class: "search-img")%>

.search-img {
width: 20px;
height: 20px;
}

Or specify the html width and height options:

<%= image_submit_tag('search.png', width: "20", height: "20")%>

Upvotes: 2

Related Questions