I have a webpage that consists of various elements, each one being a row with a fixed height. In each row, the content block should occupy only a portion of the row. This could mean taking up the entire row, the left side, right side, or somewhere in between.
To achieve this using HTML, I am considering using two buffer divs (one for the left side and one for the right side of the content). The width of these buffers will be determined programmatically (using Angular) and does not need to be set in CSS. It can simply be hardcoded in the PLNKR with inline styles.
Here is my initial plnkr.
I previously asked a similar question here, where I only needed three variations for rows (left half, right half, full width). Now, I require more flexibility.
<div class="employee-container">
<div class="left-buffer"></div>
<div class="content">
<p>Show me full width</p>
</div>
<div class="right-buffer"></div>
</div>
<div class="employee-container">
<div class="left-buffer"></div>
<div class="content">
<p>Show me floating left</p>
</div>
<div class="right-buffer"></div>
</div>
<div class="employee-container">
<div class="left-buffer"></div>
<div class="content">
<p>Show me floating right</p>
</div>
<div class="right-buffer"></div>
</div>
<div class="employee-container">
<div class="left-buffer"></div>
<div class="content">
<p>Show me in the middle</p>
</div>
<div class="right-buffer"></div>
</div>
The output will resemble the image below, but apart from floating either left or right, the element can also float in the middle.