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 8974579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:42:44+00:00 2026-06-15T18:42:44+00:00

I have 4 divs with class v_block . Each one has 2 links with

  • 0

I have 4 divs with class v_block. Each one has 2 links with class more. I’m trying to target the first link only in each div. Here’s the code http://jsfiddle.net/AAznD/2/

In real example (it’s displayed dynamically), I’m trying to change the background image of the link to make the first one appear with the wide border and the second to show just the word as you can see in the snapshot link below

it targets all the links with class “more” inside the div but it works great on jsfiddle

$(".v_block").each(function() {
  $(".v_block a.more:first-child").css({"background-image":"url(images/wide_more.gif)","width":"338px","height":"14px","left":"-23px"});
});

Here’s a snapshot: http://img90.imageshack.us/img90/8687/capturemrb.jpg.

http://img90.imageshack.us/img90/8687/capturemrb.jpg.

  • 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-06-15T18:42:45+00:00Added an answer on June 15, 2026 at 6:42 pm

    You want to use this within the each, as this will be the specific div for that loop iteration; then use find to find the a.more elements within that div.

    Updated Fiddle

    $(document).ready(function(e) {
        $(".v_block").each(function() {
            $(this).find("a.more").filter(':first').css({"color":"#d31577","text-decoration":"none"});
        });
    });
    

    You can also use first() instead of filter(":first").

    $(document).ready(function(e) {
        $(".v_block").each(function() {
            $(this).find("a.more").first().css({"color":"#d31577","text-decoration":"none"});
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 8 divs. Each div has the class 'pre-loader'. In addition to thas
Let's say I have 3 divs each with class item and only one can
I have several divs with one class on a page. <div class=main/> <div class=main/>
I have several divs that share a common class. If one of these divs
I'm trying to load text of all divs that have a particular class into
My issue is that I have two (or more) divs of the same class,
Im trying to make the divs change class from normal to thin ONLY if
I have 2 divs with 2 different class: div class name is: good div
I have 2 divs on my site, they have the class X. Each of
I have 3 divs with class: wpEdit and onClick: alertName() <div class=wpEdit onClick=alertName()>Bruce Lee</div>

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.