'How to get nested flexbox to work with image
So my use case is pretty simple. I have an image and a div with text inside.
The div has flex set to the column.
I want to get flex set to row for the text + image so that they are side by side.
While the text flexbox is congruent, currently the image displays above the text. What is wrong with my code here?
.promptParent {
display: flex;
flex-direction: row;
}
.prompt {
position: absolute;
width: 540px;
height: 180px;
left: 450px;
top: 67px;
font-family: Coiny;
font-style: normal;
font-weight: normal;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
h1 {
font-size: 72px;
}
h2 {
font-size: 36px;
margin-bottom: 0;
margin-top: 0;
}
<div class="promptParent">
<div class="prompt">
<h1>Sketch</h1>
<h2>90% Dog</h2>
<h2>10% Human</h2>
</div>
<a href="https://www.google.com">
<img src="/" alt="Refresh Button for Prompt" />
</a>
</div>
Solution 1:[1]
you need to set the z-index property (https://idg.net.ua/blog/uchebnik-css/razmetka-css/z-index)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Alexandr Korotiuk |

