I have a main div
set up as a flex box. Inside this main div
, there will be three elements positioned as inline-block: two advertisements on the left and right sides, with the content in between. My goal is to have the advertisements aligned to the left and right, and have the content in the middle act as if the ads were the margins of the page. I'm currently using a lot of
spaces to create this layout, but I'm wondering if there's a more direct way to place the two ads on either side of the flex box. I've tried using the position:right
and float:right;
properties, but they didn't produce the desired results.
Here's the code snippet:
<!---==MAIN FLEX BOX==-->
<div id="content-flex" style="display:flex;">
<!--====LEFT SIDE ADVERTISEMENT====-->
<div style="display:inline-block; position:left;">
<span style="color:white;">Advertisement</span><br/>
<a href="http://www.bmw.com.au" target="_blank">
<img src="https://media.giphy.com/media/zuTk53kSNOJJC/giphy.gif" />
</a><br/>
</div>
<!--LOTS OF USED HERE-->
<!--====MIDDLE CONTENT====-->
<div style="display:inline-block;">
<p>Loreum Ipsum...</p>
</div>
<!--LOTS OF USED HERE-->
<!--====RIGHT SIDE ADVERTISEMENT====-->
<div style="display:inline-block; position:right;">
<span style="color:white;">Advertisement</span><br/>
<a href="http://www.bmw.com.au" target="_blank">
<img src="https://media.giphy.com/media/zuTk53kSNOJJC/giphy.gif" />
</a>
</div>
</div>
Currently, this is how the page appears: