Error in width Firefox

Asked

Viewed 84 times

0

I’m looking to position a div on the site, but in Chrome appears one way and in Firefox another, IE, div in Chrome positions correctly, but in Firefox is more to the left than in Chrome and left the layout. I’m using the following code:

 <div style="width: 500px; display: table; border: 0px #000 solid;"> 
  <div style="width: 460px; position: absolute; border: 0px #000 solid; float: left; margin-left: -130px"> 
    Conteúdo
    </div>
</div>

Why does this happen? Would there be any solution to this difference?

Thank you!

  • Here to div is leaving the page in Chrome. That’s what you want?

  • Actually in Chrome appears perfectly, what I need is for Firefox to appear as in Chrome, but that’s not what happens...

  • Insert a CSS Reset in your CSS and check if the problem persists.

  • I put on the site, above all CSS that exists and the problem persists.

  • Good friend, I think it’s best that you tell us what you’re trying to do, because I still don’t understand. After that explain we can tell you the best way or if your solution is going the right way =) Anyway I gave a refactoring in your code only applying correctly some coicietos: http://jsfiddle.net/qLh6zre1/ 1º: to use Absolute in a daughter, obligatorily the parent div must have its position value defined as 'relative', if it does not do so (which was its case) the div with 'Absolute' will be positioned in relation to the body. 2nd: using Absolute does not need to use float

  • There is a Javascript script that determines in which browser the site is opened, implementing this you can fix your problem easily.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.