I'm having an issue in Chrome 40.0.2214.93 where if I override the justify-content
for an element I get some unexpected behavior.
I've created a JS Fiddle for this here: http://jsfiddle.net/n670tmeu/
html
<header id="top">
<div id="box1">
This is Box 1
</div>
<div id="box2">
This is Box 2
</div>
</header>
css
header {
background-color: #ccc;
width: 100%;
display: -webkit-flex;
display: -moz-flexbox;
display: -ms-flexbox;
display: flex;
-webkit-justify-content: flex-end;
-moz-justify-content: flex-end;
-ms-justify-content: flex-end;
justify-content: flex-end;
}
header#top {
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
justify-content: space-between;
}
#box1, #box2 {
border-width: 1px;
border-style: solid;
border-color: red;
}
You'll notice that the more specific header#top
overrides the justify-content
however in Chrome it ends up pushing the first item to the flex-end
position then adds extra space for for the space-between
.
I've tried this in FireFox 35.0.1 and Safari 7.1.2 and they both work properly. Is this a bug in Chrome or did I do something wrong?