customise the color of link_to text

316 views
Skip to first unread message

Christopher Jones

unread,
Feb 29, 2012, 1:16:51 PM2/29/12
to rubyonra...@googlegroups.com
I have a section of link to button's in my index that have associated
CSS which has a black background. Despite me in the css specifying the
text to be the color white it is staying just plain black.

How would I go about applying my own color to a link_to.

My index section is as followed:

<div id="table-3">
<table width="1160">
<thead>
<th><%= link_to 'Playstation 3', games_path(:console =>
'Playstation 3')%></th>
.............................
</thead>
</table>
</div>
and a section of my css

#table-3 th {
font-size: 12px;
font-weight: normal;
color: #FFFFFF;
line-height: 40px;
margin-bottom: 10px;
font-weight: normal;
text-align: center;

}
Thanks.

--
Posted via http://www.ruby-forum.com/.

Linus Pettersson

unread,
Feb 29, 2012, 2:48:00 PM2/29/12
to rubyonra...@googlegroups.com
Well a link_to creates a regular link in HTML so you need to style the a tag.

 #table-3 th a {
color: .....
}

Or if you want to style both regular text and links in that part:

 #table-3 th,
 #table-3 th a {
color: ...
Reply all
Reply to author
Forward
0 new messages