I'm attempting to create an interesting layout where I have text centered with an image on each side, like this
| |
| text[image] |
| [image]text |
| |
My goal is to have the text centered within the div, while having images positioned on either side of the text. How can I achieve this effect? This is what my current HTML and CSS look like:
<div class="text-container">
<h1 class="text">text1</h1><span class="image"><img src="image.svg"></span>
</div>
text-container {
text-align: center;
}
text {
display: inline;
}
The problem I'm facing is that the image
is being treated as an inline element as well, causing the entire structure to be centered instead of just the text. How can I resolve this issue?