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

  • Home
  • SEARCH
  • 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 6560895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:31:12+00:00 2026-05-25T13:31:12+00:00

.fooBar { float: left; display:inline-block; height: 600px; margin-right: 0px; } $(‘.fooBar’).click(function(){ $(this).css(‘margin-right’, ’20px’); });

  • 0
.fooBar {
        float: left;
        display:inline-block;
        height: 600px;
        margin-right: 0px;
}

$('.fooBar').click(function(){
    $(this).css('margin-right', '20px');        
});

I have a bunch of div objects which are floating and horizontally laid out. I have a button that is supposed to space them out further in real-time. You can see the line of jQuery I’m using.

However, it doesn’t seem to work… at all. Any ideas on how to dynamically change a div’s margin-right property?

EDIT: Here is the markup:

<div class="fooBar" style="width: 200px;" ><image src="../work/test1.jpg"></div>
<div class="fooBar" style="width: 210px;" ><image src="../work/test2.jpg"></div>
<div class="fooBar" style="width: 450px;" ><image src="../work/test3.jpg"></div>
<div class="fooBar" style="width: 610px;" ><image src="../work/test4.jpg"></div>

EDIT #2: Removing the extraneous ‘inline-block’ seems to have fixed the issue. Thanks all!

  • 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-25T13:31:13+00:00Added an answer on May 25, 2026 at 1:31 pm

    The display and float styles are mutually exclusive (as far as I know) so you could start fixing it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(div#foobar).live('click', function() { }); $(window).hashchange(function() { }); How can I stop firing hashchange event
Given: jQuery.extend({ fooBar: function(){ return 'baz'; } }); does it modify the base jQuery
I have a class that looks like this: public class Foobar { private float
function foobar(){ $.ajaxSetup ({cache: false}); var response = $.get(http://mysite.com/return.php) document.write(response); } I'm trying to
foo = foobar; var bar = function(){ var foo = foo || ; return
When I use NSLog(@fooBar) it prints out a lot of stuff I don't want:
My application's context root is /foobar and I am running an exploded deployment with
If I have a class org.foobar.MyClass and want to put it in a JAR
Suppose I have: public class foobar { public int lorem; public int ipsum; }
Is there any way to start foobar.js WSH-script in order that standard Task Manager

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.