I'm trying to use the :nth-child pseudo class to give each sidebar widget title a unique background colour and icon alongside the title text.
At the moment, it's displaying the background-color and background-image for :nth-child(1) for all 3 sidebar widget titles, instead of :nth-child(1) for the Twitter, :nth-child(2) for the Poll and :nth-child(3) for Instagram.
.main .sidebar .widgettitle:nth-child(1) {
background-color: #25abdc !important;
color: #ffffff;
background-image: url('/wp-content/uploads/2014/08/twitter-icon.png');
background-repeat: no-repeat !important;
background-position: 15% !important;
}
.main .sidebar .widgettitle:nth-child(2) {
background-color: #f18484 !important;
color: #FFFFFF;
background-image: url('/wp-content/uploads/2014/08/poll-icon.png');
background-repeat: no-repeat !important;
background-position: 15% !important;
}
.main .sidebar .widgettitle:nth-child(3) {
background-color: #25abdc !important;
color: #ffffff !important;
background-image: url('/wp-content/uploads/2014/08/instagram-icon.png') ;
background-repeat: no-repeat !important;
background-position: 15% !important;
}
The URL is http://1musicnetworks.kingly.co.za/.