# How to Apply styles in rhtml

**URL:** <https://www.ruby-forum.com/t/how-to-apply-styles-in-rhtml/93638>\
**Category:** Rails\
**Created:** [April 5, 2006, 11:54am UTC](https://www.ruby-forum.com/t/how-to-apply-styles-in-rhtml/93638 "2006-04-05T11:54:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [April 5, 2006, 11:54am UTC](https://www.ruby-forum.com/t/how-to-apply-styles-in-rhtml/93638/1 "2006-04-05T11:54:30Z")

</div>

Hi,

# I am new to RoR environment. I want to apply a class from my stylesheet to particular button element in my rhtml file. the class in my styesheet is :-

# buttonstyle{ color: #FFFFFF; border-style: solid; border-width: 0; background-color: #008000 }

# We can apply this class in stylesheet to button in HTML as follows:-

# 

But same thing I want to achieve inside " \<%= submit\_tag “Register” %\>"  
.  
How to do this? That is here I want to add this style only to some  
buttons inside my rhtml file . How to do this?

please help me.

Thanx.

---

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [April 5, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/how-to-apply-styles-in-rhtml/93638/2 "2006-04-05T12:09:38Z")

</div>

> Hi,
> 
> I am new to RoR environment. I want to apply a class from my stylesheet  
> to particular button element in my rhtml file. the class in my styesheet  
> \<…\>  
> But same thing I want to achieve inside " \<%= submit\_tag “Register” %\>"  
> .  
> How to do this? That is here I want to add this style only to some  
> buttons inside my rhtml file . How to do this?

\<%= submit\_tag “Register”, :class =\> :buttonstyle %\>

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)
