I’m trying to place text on top of an image. I want to achieve this using only Flexbox, without using the position property. Is it possible with Flexbox?
const Component = () => {
return (
<section>
<img src={mountains} />
<p className="paragraph">Hello everyone</p>
</section>
);
};
export default Component;
3
Answers
Either u use a position property, or make the image as a div with background image
You can make use of absolute position within the flex container.
Thanks 🙂
In css ia called "Hero image", you can do like this:
You can work with display flex inside of this div to change de "p" tag position.