1

I have a CSS property background-size set to 729px auto; for a center div for a blue frame,

Here are the results in IE and Firefox (i hide the content with red box):

enter image description here

Here is the result in Chrome:

enter image description here

Doees any know if there are special tricks for background-size property in Chrome?

Community
  • 1
  • 1
rinchik
  • 2,642
  • 8
  • 29
  • 46

3 Answers3

2

Why not use code instead of image? Problem solved.

http://jsfiddle.net/jDMxJ/

HTML:

<div class="blue">
    <div class="red">

    </div>
</div>

CSS:

.blue {
    width: 626px;
    height: 326px;
    box-sizing: border-box;
    border: 2px solid blue;
    border-radius: 10px;
}

.red {
    width: 600px;
    height: 300px;
    margin: 10px auto;
    box-sizing: border-box;
    border: 3px solid red;
    border-radius: 10px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.7);
}
Michael
  • 7,016
  • 2
  • 28
  • 41
  • My box is made from 3 parts: top center and bottom. Code is not mine i cant overwrite it i just need to fix it. :) – rinchik Mar 14 '13 at 17:36
1

Try box-sizing: border-box; in your css.

derek_duncan
  • 1,377
  • 1
  • 13
  • 22
  • Note to the OP that this won't work in IE7 if you're planning on supporting it. As for IE8, I recommend reading the chosen answer here: http://stackoverflow.com/questions/11608291/box-sizing-border-box-for-ie8 – Kyuuji Mar 14 '13 at 17:27
1

After experiments i found out that Chrome doesn't recognize the auto property in here: 729px auto;

It just cuts it out:

enter image description here

But when i changed 729px auto; to 729px 1px; it WORKED!

I see the blue frame :)

rinchik
  • 2,642
  • 8
  • 29
  • 46