Based on this example i'm trying to center horizontally a content with flex css, and usually it goes right. But when the content is very large the left part goes hidden. It happens in Chrome, and the horizontal scrollbar doesn't help. As you can see in the snippet. What I have to change to get it right?
.flex-container {
padding: 0;
margin: 0;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
}
.row {
width: auto;
border: 1px solid blue;
}
.flex-item {
background-color: tomato;
padding: 0px;
white-space: nowrap; /* added to simulate large content */
margin: 0px;
color: white;
font-weight: bold;
font-size: 2em;
text-align: left;
}
<div class="flex-container">
<div class="row">
<div class="flex-item">hidden.............................somewhere.....................................................................................................end</div>
<div class="flex-item">where</div>
<div class="flex-item">I</div>
<div class="flex-item">am?</div>
</div>
</div>
As you can see, this is a different formulation of this problem with flexbox: here