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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:57:04+00:00 2026-06-10T07:57:04+00:00

I had some problems with vertical spacing in Firefox and IE for an embarrassingly

  • 0

I had some problems with vertical spacing in Firefox and IE for an embarrassingly long time.

I am using a * selector in my css to apply margins to everything within a certain container element. Works fine in Chrome, however in FF and IE I was getting mysterious extra padding seemingly coming from nowhere, as you can observe here: http://jsfiddle.net/XrVXF/3/.

It turns out I had two separate problems. One is that non-Chrome browsers will select elements with the * selector and apply the margins and the margins show up in the browser! even though the element is invisible to things like Firebug. Should this be considered a bug? You may be asking what business is a link element doing inside the body tag. Well I could probably avoid it but it is the easiest way to do some things on my site. This page says that the * selector should only apply to block level elements in HTML5, which I am using, so in that sense it seems to me that Firefox at least is bugging out, and IE too if they are supposed to have proper HTML5 support yet. Now that I know this I can work around it but maybe there are other elements I should worry about too? (Doesn’t seem to apply to script or style tags.) Would I be better off applying margins to a large list of html elements instead of *?

The other weird thing, which you can observe in the fiddle I linked is that the clearfix on the bottom (which is not necessary in the example, but is on my site) also picks up the margins and applies them in FF and IE but not in Chrome. Which is the ‘right’ behaviour? Strangely, I noticed that turning off overflow:hidden, prevents the clearfix from taking up space, and doesn’t seem to have any detrimental effect on my site. What is overflow set to hidden for?

Correction: Oops, I was using .clear when I meant to be using .clearfix (which appends content after your floated stuff), which seems to work fine and doesn’t have margin issues.

  • 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-10T07:57:05+00:00Added an answer on June 10, 2026 at 7:57 am

    Should this be considered a bug?

    Considering you’re applying styles to elements that are in places that they shouldn’t be in the first place (link in body???), this is anybody’s guess. The likely reason why they don’t show up in Firebug is because Firebug isn’t expecting them to be there.

    In all seriousness, my best guess as to what’s going on in your fiddle is:

    • Chrome has a UA style for link elements to display: none. I imagine it does the same for any other elements that belong in the head element and not body.

    • Other browsers have no default display style for link elements, instead relying on head to have display: none to hide everything that belongs in the head element as well. So when you place a link within body, it shows up with the margins because it’s showing up with the initial value of display: inline.

      FWIW, if you give it a style of display: block, its margins will collapse and it’ll have the same apparent effect as if it had display: none as in Chrome.

    Again, this is based on invalid markup in your fiddle, so I can’t say which browser, if any, is right or wrong since all the spec says is that the page head should not be rendered. Also, cue arguments/debates on whether this is a reason not to use the * selector, or a reason not to write invalid HTML, or both…

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

Sidebar

Related Questions

I've had some problems using timeit() as an accurate benchmark when comparing longer (>
I am using phpmailer to send e-mails and had some problems with sending on
I had some problems with my subversion server and i had to restore it
I've had some problems with a Django application after I deployed it. I use
I've recently moved to Java, but I've had some problems with variable aliasing. I've
I had this problem some time ago and I gave up but lately it
Has anyone had this problem? My projects tend to have some long XML files
I have had some problems earlier which caused my program to crash in all
I had some problems figuring out a good title, but hopefully the code examples
I recently had some problems with the hibernate.cfg.xml file as I hadn't had 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.