Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 891541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:54:28+00:00 2026-05-15T13:54:28+00:00

Have a tough one here! I’m creating a blogger template, and the client wants

  • 0

Have a tough one here!

I’m creating a blogger template, and the client wants varying colours applied to headings in the right column of the template.

The problem is, I have little control over the html generated as it is controlled by the blogger engine.

What I want to be able to do, is:

Select Nth instance of an h2 element with a class of ‘title’, and apply a css style using Jquery.

A limiting factor is that it seems Jquery wants you to tell it what the parent element is so it can count elements. In this design however, the element could appear any where, and it is the instance count for the entire page I am interested in. Correct me if I’m wrong here.

I have tried the following code without success – an attempt to use the indirect decendance CSS selector:

$(document).ready(function () {

            alert('test');

            $("#RightColContent S+ h2.title:nth-child(2)").css('background-color', 'green');
            $("#RightColContent S+ h2.title:nth-child(3)").css('background-color', 'red');
        });

This code applied the style, but to all elements, presumably because I have not supplied a parent element:

$("h2.title:nth-child(1)").css('background-color', 'green');

Please see the firebog html inspection image to see the html flow.

alt text http://bombdefused.com/firebug.png

Kudos to anyone who can help me with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:54:29+00:00Added an answer on May 15, 2026 at 1:54 pm

    use the eq selector like so

    $('h2.title:eq(4)')    //selects the 5th element in the selection
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a tough one for you: I have a NotesForm object and I got
I think I have a tough one here... :( I am trying to get
Ok, here's a tough one: I have these website with several CSS files that
This is a tough one to google for. I have an XML document that's
I have a really tough situation in here. There is an array of these
Here's a tough one: I'm working on a website where most of the content
I'm having a tough time with this one, I have a class which populates
This one is tough to explain inside the title. What I have going on
Two problems in one here ... I have a set of DataRow wrappers (in
This is driving me nuts. Its a tough one to explain but I'll have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.