Vertical align two images and some multiline text - html

I'm trying to create in HTML a layout like in the image below:
I've a fixed image, (I know its size), then I need to place some multiline text, then another image, of variable size.
All the three elements should be aligned vertically i.e. the vertical centre of all them should be the same.
If it matters, this page should be shown on mobile devices.
I've checked all the related questions on stackoverflow, and tried all the possibilities I see, but with no luck.

You can use display table and play with it... not sure if you want the same layout on mobile, but you can do something like this:
<div class="content-wrapper">
<div class="col four">
<img src="http://lorempixel.com/100/100/" alt="">
</div>
<div class="col four">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
<div class="col four">
<img src="http://lorempixel.com/200/200/" alt="">
</div>
</div>
and the following css:
*{ box-sizing: border-box; }
.content-wrapper{
display-table;
max-width:800px;
}
.col{
display:table-cell;
vertical-align:middle;
padding:10px;
}
.four{
width: 33.33%
}
If you want a different layout on mobile you should problably change the display table to display relative and the with of each one of the col to 100%.
Check this example: https://jsfiddle.net/m8zqm4co/10/

You can do something slightly complicatedly simple for this:
.three-col {text-align: center; vertical-align: middle; display: table; width: 100%;}
.three-col .running-text {vertical-align: middle; display: table-cell; text-align: center;}
.three-col .running-text p {display: inline-block;}
<div class="three-col">
<div class="running-text">
<img src="http://placehold.it/100x100" alt="" class="fixed-img">
</div>
<div class="running-text">
<p>Poda Venna</p>
</div>
<div class="running-text">
<img src="http://placehold.it/200x200" alt="" class="fixed-img">
</div>
</div>
<div class="three-col">
<div class="running-text">
<img src="http://placehold.it/100x100" alt="" class="fixed-img">
</div>
<div class="running-text">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam modi cumque ratione voluptatem sunt voluptatibus veniam esse placeat amet labore cupiditate, mollitia eaque hic earum officia voluptatum et, obcaecati consequuntur.</p>
</div>
<div class="running-text">
<img src="http://placehold.it/200x200" alt="" class="fixed-img">
</div>
</div>

HTML, BODY{
height: 100%;
}
.wrap{
border: 1px solid red;
position: relative;
height: 100%;
}
.wrap img:nth-of-type(1), .wrap img:nth-of-type(2), .wrap p{
top: 50%;
transform: translateY(-50%);
position: relative;
}
.wrap img:nth-of-type(1){
position: absolute;
left: 10px;
}
.wrap img:nth-of-type(2){
display: inline-block;
vertical-align: middle;
width: 30%;
float: right;
}
.wrap p{
float: left;
width: 40%;
margin: 0 10px 0 25%;
text-align: center;
}
<div class="wrap">
<img src="http://lorempixel.com/100/100/nature/" alt="">
<img src="http://lorempixel.com/200/200/nature/" alt="">
<p>0s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially un</p>
</div>

Lets suppose you have a div where both images and the text goes inside it.
Try this out:
#container {
height: 300px;
line-height: 300px; /* same size as height */
display: inline-block;
}
.inner img{
display: inline-block;
vertical-align: middle;
}
<div id="container">
<div class="inner">
<img src="http://placehold.it/100x100">
Example Test
<img src="http://placehold.it/200x200">
</div>
</div>

Related

make the text take up as much space as the picture in grid with

i'm working on a school project where im supposed to do a portfolio. im trying to make a grid with pictuers and information next to that picture about stuff i have worked on. I'm trying to get the textbox to be as big as the picture. I have tried jusing flexbox and a lot of other stuff but can't get it to work. is there someone who can help me?
*{
box-sizing: border-box;
}
body{
background-color: #f4f4f4;
padding: 20px;
font-family: Arial;
}
.container {
max-width: 1600px;
margin: 0 auto;
}
.row {
margin:8px-16px;
}
.row,
.row > .column {
padding:2px 0px;
}
.column {
float:left;
width:50%;
}
.row:after {
content:"";
display:table;
clear:both;
}
.content {
background-color: white;
padding: 10px;
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
#media screen and (max-width: 600px) {
.column {
width:100%;
}
}
<div class="container">
<div class="row">
<div class="column">
<div class="content">
<h3>Hemsida 1</h3>
<p>Lorem ipsum.</p>
</div>
</div>
<div class="column">
<div class="content">
<img src="atleta1.jpg" style="width:100%">
</div>
</div>
</div>
<div class="row">
<div class="column">
<div class="content">
<img src="atleta1.jpg" style="width:100%">ยด
</div>
</div>
<div class="column">
<div class="content">
<h3>Hemsida 2</h3>
<p>Lorem ipsum.</p>
</div>
</div>
</div>
<div class="row">
<div class="column">
<div class="content">
<h3>Hemsida 2</h3>
<p>Lorem ipsum.</p>
</div>
</div>
<div class="column">
<div class="content">
<img src="atleta1.jpg" style="width:100%">
</div>
</div>
</div>
</div>
You have complicated the layout very much. How do you like this layout option?
Each line is divided into two parts of 50%.
A small bonus: with small screens, due to the Flexbox property order, the description block is located above the picture.
P.S. Of course, this is not the final option. You can continue to improve it
Result
* {
box-sizing: border-box;
}
body {
background-color: #f4f4f4;
padding: 20px;
font-family: Arial;
}
.container {
max-width: 1600px;
margin: 0 auto;
padding: 0;
list-style: none;
}
.item {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
;
padding: 10px;
background-color: white;
}
.item__desc {
flex-basis: 50%;
}
.item__pic {
flex-basis: 50%;
}
.item_img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
#media screen and (max-width: 600px) {
.item {
flex-direction: column;
width: 100%;
}
.item__desc {
order: -1;
}
}
<ul class="container">
<li class="item">
<div class="item__desc">
<h3>Hemsida 1</h3>
<p>Lorem ipsum.</p>
</div>
<div class="item__pic">
<img class="item_img" src="https://picsum.photos/536/354"></div>
</li>
<li class="item">
<div class="item__pic">
<img class="item_img" src="https://picsum.photos/536/354">
</div>
<div class="item__desc">
<h3>Hemsida 2</h3>
<p>Lorem ipsum.</p>
</div>
</li>
<li class="item">
<div class="item__desc">
<h3>Hemsida 2</h3>
<p>Lorem ipsum.</p>
</div>
<div class="item__pic">
<img class="item_img" src="https://picsum.photos/536/354"></div>
</li>
</ul>
And same code on CodePen
will be enough for homework. Edit and improve codes
*{
margin: 0;
padding: 0;
box-sizing:border-box;
}
.box{
margin-bottom:20px;
background: #3498db;
height:500px;
}
.box-left{
width:50%;
float:left;
height:500px;
padding:50px;
}
.box-left h3{
margin-bottom: 15px;
}
.box-right{
width:50%;
float:right;
height:500px;
}
.box-right img{
width:100%;
height:100%;
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="box">
<div class="box-left">
<h3>Head</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur quas a velit. Aut nihil, modi nobis corporis eveniet ratione aperiam repellat maiores corrupti quidem ipsam animi officiis, fugit quasi rem!</p>
</div>
<div class="box-right">
<img src="https://i.ibb.co/S6PdtwP/69037904-2403297686584790-2753464427788369920-n.jpg" alt="">
</div>
</div>
<div class="box">
<div class="box-left">
<h3>Head</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur quas a velit. Aut nihil, modi nobis corporis eveniet ratione aperiam repellat maiores corrupti quidem ipsam animi officiis, fugit quasi rem!</p>
</div>
<div class="box-right">
<img src="https://i.ibb.co/S6PdtwP/69037904-2403297686584790-2753464427788369920-n.jpg" alt="">
</div>
</div>
</body>
</html>
live demo
codepen live demo

How can I display image behind div with bootstrap?

I have 2 rows in my container. In the second row I have 2 elements one and two. Now I am trying to display the image behind those too almost like a background. This is the html:
<div class="container">
<div class="row">
<img src="someimageurl" alt="" />
</div>
<div class="row">
<div class="col-md-6">one</div>
<div class="col-md-6">two</div>
</div>
</div>
codepen
Check if his works for you.
CSS:
.container{
border: 4px solid red;
position: relative;
overflow: hidden;
}
.contentBox {
min-height: 300px
}
.imgBox {
position: absolute;
top: 0;
let: 0;
width: 100%;
z-index: -1;
}
.imgBox img {
width: 100%;
margin: 0;
}
HTML:
<div class="container">
<div class="row contentBox">
<div class="col-md-6">one</div>
<div class="col-md-6">two</div>
</div>
<div class="imgBox row">
<img src="imageURL.jpg" alt="" />
</div>
</div>
enter link description here
Is background-image what you're looking for?
HTML
<div id=RowDivWithBackground class=row>
</div>
CSS
.RowDivWithBackground {
background-image: url('url/to/image');
other-css-do-dads /*Probably some rgba action*/
}
use css to do that
#{your div ID}{
background-image: url("backgroundImage.png");
}
i think this may be help you
try this code
html
<div class="row">
<div class="bg clearfix">
<div class="col-md-6">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium optio itaque quas ab facere, ipsa cumque consequatur nam id voluptatibus numquam, sapiente suscipit doloremque blanditiis non, ipsam sint vel molestias.</div>
<div class="col-md-6">two</div>
</div>
</div>
css
.bg
{
background-image:url(http://data.whicdn.com/images/12849966/large.jpg);
background-position:center;
background-size:cover;
}
hope it helps
If you really need to use the img-tag, try to use position: fixed and z-index: -1 (or -2, -3, ...)
.container {
border: 4px solid red;
position: relative;
}
#imageAsBackground {
z-index: -1;
position: fixed;
}
<div class="container">
<div class="row">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQWTPbXeQy0Sy6xCbSwL_Vc4oQtMS-UNkUPOwRb3TxWHKKNlZ5Ycg" id="imageAsBackground" alt="" />
</div>
<div class="row">
<div class="col-md-6">one</div>
<div class="col-md-6">two</div>
</div>
</div>
If you could use the image as a real background, try to use css for this then.
Like
.container{
border: 4px solid red;
}
.coolBackground {
background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQWTPbXeQy0Sy6xCbSwL_Vc4oQtMS-UNkUPOwRb3TxWHKKNlZ5Ycg");
background-size: cover;
}
<div class="container">
<div class="row coolBackground">
<div class="col-md-6">one</div>
<div class="col-md-6">two</div>
</div>
</div>
background-size: cover; will adjust the image to the width of your div.

How design an unordered list of images horizontally with Bootstrap?

I am a new web designer and I am struggling right now in designing unordered list of icons to be displayed horizontally without the bullet.
Here's my html code:
<section id="call-to-action" class="section-padding">
<div data-velocity="-.3" class="overlay-bg cta-bg"></div>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="cta-text text-center">
<h2>Call to action</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eius labore itaque, nam eaque aut repellat ratione nesciunt explicabo numquam sit.</p>
<div class="partners">
<ul style="list-style: none;">
<li>
<img class="img-responsive"
title="Illustrator" alt="Illustrator"
src="../Assets/img/software/illustrator_icon.png" />
<img class="img-responsive"
title="Photoshop" alt="Photoshop"
src="../Assets/img/software/photoshop_icon.png" />
<img class="img-responsive"
title="InDesign" alt="InDesign"
src="../Assets/img/software/inDesign_icon.png" />
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- End call to action -->
CSS Code:
#call-to-action {
position: relative;
}
.section-padding {
padding: 50px 0;
}
.partners ul {
list-style: none;
margin: 0;
padding: 0;
}
.partners ul li {
display: inline-block;
float: left;
width: 20%;
}
Here's the link to JSFiddle that includes all of my code: https://jsfiddle.net/nta1qov2/
Could you please tell me how I can do this?
you can try this one:
#call-to-action {
position: relative;
}
.section-padding {
padding: 50px 0;
}
.partners ul {
list-style: none;
margin: 0;
padding: 0;
}
.partners ul li {
display: inline-block;
float: left;
/*width:20%; remove width 20% ;*/
width: 100%; /* add width :100%;*/
}
DEMO HERE
Add this css code":
.partners ul li {
position: absolute;
text-align:center;
display: inline-block;
width: 100%;
}
[UPDATED DEMO HERE]2
If you wish to do it through only twitter-bootstrap, then the following code illustrates the same:
HTML:
<div class="form-group">
<div class="pull-left control-label">
<img src="../img1.jpg" />
</div>
<div class="pull-left control-label">
<img src="../img2.jpg" />
</div>
<div class="pull-left control-label">
<img src="../img3.jpg" />
</div>
</div>
<div class="clearfix"></div>
Here, pull-left, is to make unordered horizontal list.
control-label for right indentation.
form-group for vertical indentation.
clearfix for nullifying the float as a result of pull-left after completion.

Image and text in one row aligned and responsive

I am trying to accomplish
IMG + text in one row, like in this example
I would like the image to be responsive somehow... so when I resize the window, the image remains there, but also text with background...
Also, I need the text to be vertically aligned... any ideas?
Any help is greatly appreciated! thanks
This may help you, later you can control with media-queries and place your image or content wherever you want.
.img-text {
width: 100%;
display: table;
table-layout: fixed;
}
.photo,
.content {
display: table-cell;
vertical-align: middle;
}
.photo {
width: 40%;
}
.photo img {
max-width: 100%;
height: auto;
}
.content {
width: 60%;
padding: 15px;
}
<div class="img-txt">
<div class="photo">
<img src="http://lorempixel.com/image_output/people-q-c-640-480-6.jpg" alt="">
</div>
<div class="content">
<h1>Something</h1>
<p>Something more</p>
<p>You should have tried yourself first, then asked with your code as example</p>
</div>
</div>
It would be really good if you had posted some of your code. I have already done a similar example, which I would like to share. You need to use positioning for this case. This is a case of fixed-fluid:
+-------+-----------+
| FIXED | FLUUUUUID |
+-------+-----------+
Or
+-------+-----------+
| FIXED | FLUUUUUID |
| | FLUUUUUID |
+-------+-----------+
Fixed-Fluid Model. In my snippet, I have demonstrated two kinds of examples. In the first case, the fluid is less in size. And the next has too long content.
Snippet
.parent {position: relative; margin: 0 0 15px; border: 1px solid #999; padding: 5px; padding-left: 100px;}
.parent .fixed {position: absolute; left: 5px; width: 90px; background-color: #99f;}
.parent .fluid {background-color: #f99;}
<div class="parent">
<div class="fixed">Fixed</div>
<div class="fluid">Fluid</div>
</div>
<div class="parent">
<div class="fixed">Fixed</div>
<div class="fluid">Fluid Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque animi placeat, expedita tempora explicabo facilis nulla fuga recusandae officia, maiores porro eaque, dolore et modi in sapiente accusamus id aut.</div>
</div>
Working Snippet
.parent {position: relative; margin: 0 0 15px; padding: 5px; padding-left: 100px; min-height: 50px;}
.parent .fixed {position: absolute; left: 5px; width: 90px; background-color: #99f;}
.parent .fluid {}
<div class="parent">
<div class="fixed">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADsUlEQVR4nO3aS4gcVRTG8TsTgjMxCCoYo1ExulCjLjRCGElwISooLgRF1JWjIaIYooIQH5gsghtfIBoiAWeCCLoRxYX4IAjqJkpEXWlAUUQUQWMyMer0z0VVOzVl3X5NV3dPT/2hF9P3u4dzvuqpOvfWDaGioqKioqKiYgDBJjyMLTi13/n0DIzjdfP5BTf0O7eegOcUcxjn9ju/UsEYjkUMgB39zrFUcFaD4uHlfudYKji7iQFT/c6xNHAS3l2SBmAVPmlS/PAZgBFsxm8tFD9cBuBMvNFi4cNjAM7DNP5qs/jFbQBW41nMdFD44jQAo7gWr+H4Agrv2ACsxc162UViPZ7CD10oumMD8Dhm07k17Cyj2DFcjSckz/E/ulx0RwbgskiMG/PCk3E9NmKkSdDVabFbsQcf4fcSC85TaABWYGXuu8lIjEMYq4suxU+ZwTcxgVsla/EX8Da+wtGSimqHqVyRJ0guxHH8g30YT8eubBDnznqAZq3noJE34OkCzXRm/MNInI/rgp9LS7Uc8gZ8U6CpYUM6fkX6dxEXBK23oINC3oADEd2rGc37Ec29QW9vYN0gb8DmiO5PrEg1d0c000G5j6wyyBuwHN9GtFelmosj4wcDjpSRZYn87zGI5yPae9LxZeaaoSzfBwvry/tBkQFbI9rHMppfC8ZngsYbkINIkQEPRrSPZDRFN/sjQXcWKL2kyIDdEe2WzH2i6FH4XcDfZWVaEvmb4ErFP2+YSDWxNcGnQdI+LibyBtwX0c2Ya4nvj2j2BvEuaVDJG/BlRLcvo/ksopkcBgOK9htmcXk6vikSp4bzA74uKdGyyBvwYoFmTzo2is8jcfbXA9xufpMQ6wyPNRjrJXkDxiVL4FnJ/WzK3P/+dQ3i3JYNMiHZvnoA6yITjuI0yaurayTNx27s19sVZWxDZAwn5r6LNUgHsawoTn3ij5GJ70jdzWiXS65Ar2hnS2yiYH4NG5tN3NUggUPYjlvwEL5ooD1g/m5TN2h3U3SXuRv9LLa3Mul0C18jzGCN5Bdyk2RbrRs9Ryfb4hdJtsUvbGfSXQtMdFtBzDWSK7KQvcXevRjBMx0muRejDeKegZd09ovo7ZshPKr19cIsdjQqPhd7HT4YaAPSRC/BWw2MqOE9rO8g9ojkGNzhgTUgk+wq3IGdeDL9TGJtF2KfI77BORgGlI3kJccrS9aAEJb4IakQqmNy1UHJEJb4UdkQqsPS/4EN2CZ59J7S73wqKioqKioqhot/AedCJIQMIKG9AAAAAElFTkSuQmCC"/></div>
<div class="fluid">The Text</div>
</div>
<div class="parent">
<div class="fixed">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADsUlEQVR4nO3aS4gcVRTG8TsTgjMxCCoYo1ExulCjLjRCGElwISooLgRF1JWjIaIYooIQH5gsghtfIBoiAWeCCLoRxYX4IAjqJkpEXWlAUUQUQWMyMer0z0VVOzVl3X5NV3dPT/2hF9P3u4dzvuqpOvfWDaGioqKioqKiYgDBJjyMLTi13/n0DIzjdfP5BTf0O7eegOcUcxjn9ju/UsEYjkUMgB39zrFUcFaD4uHlfudYKji7iQFT/c6xNHAS3l2SBmAVPmlS/PAZgBFsxm8tFD9cBuBMvNFi4cNjAM7DNP5qs/jFbQBW41nMdFD44jQAo7gWr+H4Agrv2ACsxc162UViPZ7CD10oumMD8Dhm07k17Cyj2DFcjSckz/E/ulx0RwbgskiMG/PCk3E9NmKkSdDVabFbsQcf4fcSC85TaABWYGXuu8lIjEMYq4suxU+ZwTcxgVsla/EX8Da+wtGSimqHqVyRJ0guxHH8g30YT8eubBDnznqAZq3noJE34OkCzXRm/MNInI/rgp9LS7Uc8gZ8U6CpYUM6fkX6dxEXBK23oINC3oADEd2rGc37Ec29QW9vYN0gb8DmiO5PrEg1d0c000G5j6wyyBuwHN9GtFelmosj4wcDjpSRZYn87zGI5yPae9LxZeaaoSzfBwvry/tBkQFbI9rHMppfC8ZngsYbkINIkQEPRrSPZDRFN/sjQXcWKL2kyIDdEe2WzH2i6FH4XcDfZWVaEvmb4ErFP2+YSDWxNcGnQdI+LibyBtwX0c2Ya4nvj2j2BvEuaVDJG/BlRLcvo/ksopkcBgOK9htmcXk6vikSp4bzA74uKdGyyBvwYoFmTzo2is8jcfbXA9xufpMQ6wyPNRjrJXkDxiVL4FnJ/WzK3P/+dQ3i3JYNMiHZvnoA6yITjuI0yaurayTNx27s19sVZWxDZAwn5r6LNUgHsawoTn3ij5GJ70jdzWiXS65Ar2hnS2yiYH4NG5tN3NUggUPYjlvwEL5ooD1g/m5TN2h3U3SXuRv9LLa3Mul0C18jzGCN5Bdyk2RbrRs9Ryfb4hdJtsUvbGfSXQtMdFtBzDWSK7KQvcXevRjBMx0muRejDeKegZd09ovo7ZshPKr19cIsdjQqPhd7HT4YaAPSRC/BWw2MqOE9rO8g9ojkGNzhgTUgk+wq3IGdeDL9TGJtF2KfI77BORgGlI3kJccrS9aAEJb4IakQqmNy1UHJEJb4UdkQqsPS/4EN2CZ59J7S73wqKioqKioqhot/AedCJIQMIKG9AAAAAElFTkSuQmCC"/></div>
<div class="fluid">A longer text. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus magni ipsam facilis laboriosam nesciunt eveniet obcaecati dicta laborum voluptatem reiciendis, possimus vel enim. Dignissimos assumenda ipsa aut. Facere, unde animi.</div>
</div>
.imgBox, .textBox{
float: left;
box-sizing: border-box;
}
.textBox{
height: 70px;
width: 100px;
background-color: grey;
color: white;
text-align: center;
padding-top: 25px;
}
<div>
<div class="imgBox">
<img src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" width="100" height="70"/>
</div>
<div class="textBox">
your text
</div>
</div>

Vertical align floated image + container (H+p)

I want to center an floated image and a container (paragraph + heading):
.row {
display: block;
/* width: 100%; */
}
.left {
float: left;
}
.right {
float: right;
}
<div class="row">
<div class="container">
<img class="right" src="" width="300" height="300" />
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet</p>
<div style="clear: both"></div>
</div>
</div>
<div class="row">
<div class="container">
<img class="left" src="" width="300" height="156" />
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet</p>
<div style="clear: both"></div>
</div>
</div>
Here is also a live version of the problem. I have cleared the floats but now I can't center the .img and .container element. What would you slove the problem?
You have no luck with floated elements since they don't obey vertical-align. You can instead use display: table-cell along with vertical-align: middle and that would work perfectly. Albeit you will need to modify your HTML structure a little bit to place the content first before the image and vice versa depending on the way you want the content and images to appear on the front-end.
.container {
display: table;
}
.content {
width: 50%;
display: table-cell;
vertical-align: middle;
}
.image {
width: 50%;
display: table-cell;
vertical-align: middle;
}
.image img {
width: 100%;
}
<div class="row">
<div class="container">
<div class="content">
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet</p>
</div>
<div class="image">
<img src="http://dev.dashbox.si/media/wysiwyg/vsebina-dashboxa.jpg" />
</div>
</div>
</div>
<div class="row">
<div class="container">
<div class="image">
<img src="http://dev.dashbox.si/media/wysiwyg/vsebina-dashboxa.jpg" />
</div>
<div class="content">
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet</p>
</div>
</div>
</div>
Basically what you can do to vertically align text is change the display of the container to table then the paragraph to table-cell and then set the vertical-align to middle looking like this:
.row {
display: table;
overflow: hidden;
}
.left, .right {
display: table-cell;
vertical-align: middle;
}
You might also need to set overflow to hidden on the container so that the height is maintained because of the floats.