I'm trying to have 2 paragraphs, one below the other with different styling, and an image next to them and aligned with them in flexbox.
I cannot seem to get it to align next to the items. Currently, I have the image flex-end aligned to the right and the text on the left, but I need them to be together.
I have tried moving them in and out of being the same div but I'm just getting nowhere. I'm not sure what I need to do to get the placeholder image next to the hero-container text.
CSS:
body {
margin: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
background-color: black;
}
div.Hero-container {
display: flex;
flex-direction: column;
width: 80%;
}
p{
display: flex;
}
p.intro-text{
order: 1;
color: #F9FAF8;
font-weight: bold;
font-size: 48px;
align-self: left;
width: 80%;
}
p.secondary-text{
order: 3;
color:#e5e7eb;
font-size: 18px;
}
img {
margin-right: 10px;
width: 350px;
height: 150px;
}
.image-container {
display: flex;
flex-direction: row;
justify-content: right;
height: 72px;
padding: 10px 0;
}
HTML:
<div class="header">
<header class="Hero">Header Logo</header>
<ol>
<li><a href="www.reddit.com">Link One</a></li>
<li><a href="www.reddit.com">Link Two</a></li>
<li><a href="www.reddit.com">Link Three</a></li>
</ol>
</div>
<div class="Hero-container">
<p class="intro-text">
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...
</p>
<p class="secondary-text">Blah blah Blah</p>
</div>
<div class="image-container">
<img src="https://via.placeholder.com/350x150" alt="Placeholder Image">
</div>
</body>
</html>```