<section class="tri-element-rows">
<div class="left-element">
<p>
<span class="title">LEFT ELEMENT</span><br>
<span class="subtitle"> I am the left element</span>
</p>
</div>
<div class="middle-element">
<img>
</div>
<div class="right-element">
<p>
<span class="title">RIGHT ELEMENT</span><br>
<span class="subtitle"> I am the right element</span>
</p>
</div>
</section>
<section class="tri-element-rows">
<div class="left-element">
<p>
<span class="title">LEFT ELEMENT</span><br>
<span class="subtitle"> I am the left element</span>
</p>
</div>
<div class="middle-element">
<img>
</div>
<div class="right-element">
<p>
<span class="title">RIGHT ELEMENT</span><br>
<span class="subtitle"> I am the right element</span>
</p>
</div>
</section>
CSS
/*------------------------------------------------
* *
* ROW CONTAINER *
* *
------------------------------------------------*/
section.tri-element-rows{
margin: 3em auto;
position: relative;
display: block;
width: 100%;
/* Visualize the element */
border-style: solid;
border-width: 5px;
border-color: grey;
/* This should auto size around the elements within*/
height: 10em;
}
section.tri-element-rows div{
/* Visualize the element */
border-style: solid;
border-width: 5px;
position: relative;
}
/*------------------------------------------------
* *
* LEFT ELEMENT *
* *
------------------------------------------------*/
section.tri-element-rows div.left-element {
width: 33%;
/* Should be left of the middle element */
float:left;
/* Needs fixed spacing */
}
section.tri-element-rows div.left-element p{
text-align: right;
margin-right:10px;
}
/*------------------------------------------------
* *
* MIDDLE ELEMENT *
* *
------------------------------------------------*/
section.tri-element-rows div.middle-element {
/* Should be centered always */
position: absolute;
/* Fixed size */
width: 150px;
height: 150px;
/* Move back to center size */
margin-left: -75px;
/* Position at middle of the page */
left: 50%
}
section.tri-element-rows div.middle-element img {
width: 150px;
height: 150px;
}
/*------------------------------------------------
* *
* RIGHT ELEMENT *
* ...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.