Does 'position: absolute' conflict with Flexbox?
<p>I want to make a <code>div</code> stick on the top of the screen without any influence to other elements, and its child element in the center.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code> .parent {
   display: flex;
   justify-content: center;
   position: absolute;
 }</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
  &lt;div class="child"&gt;text&lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>When I add the <code>position: absolute</code> line, <code>justify-content: center</code> becomes invalid. Do they conflict with each other and, what's the solution?</p>

<p><strong>EDIT</strong></p>

<p>Thanks guys it's the problem of parent width. But I'm in React Native, so I can't set <code>width: 100%</code>. Tried <code>flex: 1</code> and <code>align-self: stretch</code>, both not working. I ended up using <a href="https://facebook.github.io/react-native/docs/dimensions.html" rel="noreferrer">Dimensions</a> to get the full width of the window and it worked.</p>

<p><strong>EDIT</strong></p>

<p>As of newer version of React Native (I'm with 0.49), it accepts <code>width: 100%</code>.</p>