By TSNetwork on
Hello,
I'm trying to edit my theme's CSS and give a view's field's even and odd rows different background images.
I have this code:
.views-field-title {
width:100%;
background:url(img/background.jpg) top left repeat #000000;
border:3px;
text-align:center;
padding: 3px;
}
It applies to every row. I want to have a different background for the odd and even rows.
I tried everything, searching, changing the code to things like ".views-field-title odd" or any other variation I find that might do it, but nothing so far.
My coding and CSS skills are very basic as you can see, I would be really thankful if someone helps me out with the code.
Comments
Instead of .views-field-title
Instead of .views-field-title try .views-row-odd and .views-row-even.
Firebug or Chrome's Inspector
Sometimes, it is best to use Firefox Firebug or Chrome's Inspect element to look at the HTML generated by Views. Just right-click on the view data and choose "Inspect element". You will see the view's HTML.