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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:29:36+00:00 2026-06-09T23:29:36+00:00

I have a drupal view which pulls out project screen shots and puts them

  • 0

I have a drupal view which pulls out project screen shots and puts them into divs, and I was wondering if there was a clever way in CSS to align them in a row of 3 columns with a margin without styling each box individually.

First row styles easily, because i can give div-even a left and right margin, but then row 2 i need to give the div-odd a margin and the even div no margin

I have created a J fiddle Mockup of where I am at. I can style the class of the first and last div and also give a rule to odd and even, but because i don’t know how project screen shots their will be I’d prefer not to style each div box individually

http://jsfiddle.net/eGWY6/

  • 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-09T23:29:38+00:00Added an answer on June 9, 2026 at 11:29 pm

    You could solve this this way:

    jQuery:

    // Remove margin on third project screen shot
    if($("#projects-wrapper div").length){
      $("#projects-wrapper div").each(function(i){
        var remainder = (i + 1) % 3; //3th change to your needs
        if(remainder === 0){
          $(this).addClass("last");
        }
      });
    }
    

    CSS:

    .last {margin-right: 0;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Drupal view which should output a video player using flash. I
I have this drupal slideshow which pulls images from a folder sequentially by image
I have a view of nodes in drupal. Each node has button which (is
I have a Drupal view that displays vacation leaves for a particular employee. I
I'm using Drupal 6. I have a custom view that needs to be filtered
I have Drupal 7 site which is working fine. I added a custom PHP
I have Drupal 6 website which is using FCK Editor as HTML editor. It
I have some view which lists my module table entries. What is the most
I have a few Views on my Drupal 6 site which take care of
I'm using Drupal . I have a module which loads a form onto a

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.