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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:54:29+00:00 2026-05-27T21:54:29+00:00

I have a page that is receiving a big left margin from a global

  • 0

I have a page that is receiving a big left margin from a global style sheet that I’m not allowed to change. The margin is actually written inline by the script/stylesheet so I can’t change it in my print style.
I was able to find a jQuery solution that seems to work in FF and IE, but unfortunately not in Chrome.
jquery function:

$('#page').each(function(idx,el){
  el.style.margin='';
});

I’ve tried everything from the jquery css.(‘margin-left’,’0′) to using the DOM attributes and nothing works! Any help is much appreciated.

document.getElementById("page").style.margin="0";
document.getElementById("page").setAttribute("margin","0");
document.getElementById("page").setAttribute("margin-left","0");
  • 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-27T21:54:30+00:00Added an answer on May 27, 2026 at 9:54 pm

    Description

    If you are using jQuery, you should use the jQuery functions because there are made for cross browser compatibility.

    The Problem is that you are using an id. A id should be unique in your document. jQuery knows that you are using the id selector and changes only the first element.

    Use a class instead. Check out the jsFiddle demonstration i have created.

    Sample

    Css

    .page { margin: 10px }
    

    jQuery

    $('.page').css("margin", "");
    

    More Information

    • jSFiddle Demonstration
    • jQuery Documentation – .css()

    Update

    w3c says: The id attribute specifies a unique id for an HTML element (the id attribute value must be unique within the HTML document).

    But ok, you said that the page is an existing one and you want not change from id to `class. That is not standard and not good for search engine optimization.

    You can do this to get it work with id.

    Sample

    Html

    <div style="margin: 10px" id="page">div1</div>
    <div style="margin: 10px" id="page">div2</div>
    

    jQuery

    $('[id="page"]').css("margin", "");
    
    • jsFiddle Demonstration
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that has an iframe From one of the pages within
I have a form on my page that I am having trouble receiving a
I have a page confirm_payment.php receiving POST data from other pages. How can I
I have a PHP page receiving input from an HTML form via $_POST. The
I have a div that is receiving content from an ajax call. Right now
I have page that is receiving a query string and I want it so
I have a Java module that is receiving a compressed string from a remote
I have a checkbox on my page. How do I stop it from receiving
I have a textarea on a page which I use for receiving keywords from
I have a page that is generated which inserts an HTML comment near the

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.