Vertical and horizontal align image and text in container bootstrap - html

I have an image with some text below it, however, I am trying to get them to align vertically and horizontally in the middle. It must also be responsive to both mobile and web view, is it possible?
Here's what I have tried
<style>
.img-responsive {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
</style>
<div class="container">
<img src="..." class="img-responsive"/>
<h4 style="text-align: center;">Sample Text 1</h4>
<p style="text-align: center;">Sample Text 2</p>
</div>

Try this
Html
<div class="container">
<img src="https://s33.postimg.cc/ud7gljfb3/ripple_Bg.jpg" class="img-responsive"/>
<div class="textblock">
<h4 style="text-align: center;">Sample Text 1</h4>
<p style="text-align: center;">Sample Text 2</p>
</div>
</div>
Css ( 2 ways to make center )
1. modern browser supported
.container {
width: 500px;
height: 500px;
position: relative;
}
.img-responsive {
z-index: -1;
position: absolute;
display: block;
width: 100%;
}
.textblock {
width: 109px; /*need to give width*/
display: inline-table; /*ie not supported*/
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
}
1. IE not supported
.container {
width: 500px;
height: 500px;
position: relative;
}
.img-responsive {
z-index: -1;
position: absolute;
display: block;
width: 100%;
}
.textblock {
width: 109px; /*need to give width*/
height: 100px; /*need to give height*/
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
}
Hope it helps:)

You can use the media object in bootstrap
<div class="media">
<img class="align-self-center mr-3" src=".../64x64" alt="Generic placeholder image">
<div class="media-body">
<h5 class="mt-0">Center-aligned media</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p class="mb-0">Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
The documentation link above show you how to align images in different positions. The grid in Bootstrap4 is based on Flex, which allow you to do many advanced layouts. Check it out.

Related

How to make the image displays right below the text, not behind the next div content?

I'm new to StackOverflow, still learning fullstack web-development.
Just started creating my own website and I'm stuck at my image keeps displaying behind the next div's item, not right below the text. :(
Please help me!! Thank you :D
HTML
<div class="wrapper">
<div class="container">
<div class="row">
<div class="col-sm-8 text-container">
<p>
<h1>laoreet ante eget, vehicula ligula.</h1><br />
sed odio eu, eleifend aliquet urna. Donec ultrices dapibus ipsum.
Suspendisse ac hendrerit augue. Pellentesque massa eros, auctor ac sapien a, lacinia
luctus dolor. Proin et eleifend quam. Mauris tristique dictum tellus vitae molestie.
Praesent
auctor justo nisl, eu porta leo aliquam at.
</p>
</div>
<div class="col-sm-4">
<img src="images/picture.png" class="picture-container my-picture" alt="">
</div>
</div>
</div>
CSS
.wrapper {
width: 100%;
height: 700px;
background-color: #ed8d8d;
}
.container {
height: 500px;
padding: 80px 0px;
}
.text-container {
width: 700px;
height: 500px;
float: left;
margin-top: 80px;
text-align: right;
}
.picture-container {
overflow: hidden;
}
/* IMAGES */
.sophie-picture {
height: 450px
}
Inside your HTML code, the "picture-container" class on the IMG element should likely be moved, so it sits on the "col-sm-4"-div above.
I suspect the "my-picture" class on the IMG and the "sophie-picture" class in the CSS should be the same thing ? most likely you've renamed one of them and forgot to do the same in the other file, If so you should rename one so their names match up again.
There's a </div> missing at the end of the HTML code here, but i suspect that is likely just the case here because you only pasted part of your HTML document, and not the case in your own version.
The reason your image and text-container overlap is the use of float.
Removing that likely solves most of the issue.
But judging by the col-sm-8 style classnames i'm guessing you're using something like bootstrap ? Those classes apply a whole bunch of CSS (that you don't particularly have to worry about), but they provide the "column(s) within row; row(s) within container"-style of rapidly building a layout. If you're using those classes its best not to mix it with floats, manual width/height and margin statements, or really any significant CSS (just cosmetic only things like colors, font bold/italic, ...). Bootstrap has many classes so you effectively don't have to write any CSS yourself (classes like mb-4 or such for margins for example).
I would suggest using 1 or the other for a given container:
either building it the bootstrap-way with container/row/col and then using the margin/color/etc classes from boostrap.
or writing the CSS yourself, but then not using those bootstrap classes.
move the h1 tag above the p tag and set margin-bottom on the p tag to 0. also picture-container has no declared height so overflow:hidden won't do anything there. aplly overflow:hidden to wrapper.
.wrapper {
width: 100%;
height: 700px;
background-color: #ed8d8d;
border:solid 2px red;
overflow:hidden;
}
.container {
height: 500px;
padding: 80px 0px;
border:solid 2px blue;
}
.text-container {
width: 700px;
height: 500px;
float: left;
margin-top: 80px;
text-align: right;
border:solid green 2px;
}
.picture-container {
overflow: hidden;
}
p{
margin-bottom:0}
/* IMAGES */
.sophie-picture {
height: 450px
}
<div class="wrapper">
<div class="container">
<div class="row">
<div class="col-sm-8 text-container">
<h1>laoreet ante eget, vehicula ligula.</h1>
<p>
sed odio eu, eleifend aliquet urna. Donec ultrices dapibus ipsum.
Suspendisse ac hendrerit augue. Pellentesque massa eros, auctor ac sapien a, lacinia
luctus dolor. Proin et eleifend quam. Mauris tristique dictum tellus vitae molestie.
Praesent
auctor justo nisl, eu porta leo aliquam at.
</p>
</div>
<div class="col-sm-4">
<img src="https://via.placeholder.com/450" class="picture-container my-picture" alt="">
</div>
</div>
</div>
</div>

How can I do a module like this? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to do a boxes like below for my website's events but I got stuck.
The problems I can not solve:
Reduce images to the same size
Create modules of the same size
Align the modules in the same line
.background {
width:360px;
height:200px;
}
.image{
width:100%;
height:100%;
}
.text {
width:100%;
height:25%;
color:#ffffff;
background:blue;
z-index: auto;
}
<div class="background">
<div class="image">
<img src="https://zero.eu/content/uploads/2017/01/Ryley_Walker-730x490.jpg" width="360" height="200" class="wp-image-156 hoverZoomLink" alt="Willie Peyote Live">
</div>
<div class="text">
<p>test test test</p>
</div>
</div>
Questions... and answers. Let's go over the issues you have one by one.
Reduce images to the same size
It's best to let CSS take care of this. By setting the background of an element to the image you want and setting the background-size to cover, the browser will scale the image such that the aspect ratio is maintained and the image nicely covers all of the element you put it in.
Now make all elements the same size and voilĂ , this point is done.
Create modules of the same size
This can be achieved in two ways.
Set fixed sizes on your boxes.
Use more advanced CSS, in particular the flexbox layout module.
To keep things simple, I'll use the first approach for now. Read up on flex if you are interested in it!
Align the modules in the same line
This can be achieved in many ways, but the most straightforward one is setting display to inline-block. This will make it so that every block in your module is treated as a, well, a block, meaning that it can have a set width and height. At the same time, it is laid out as if it were text. So, one block after another will simply go on the same line. When that does not fit on screen anymore, blocks will flow to the next line.
Putting this all together. Here is a quick toy example that includes all of the above. It should serve as a good starting point to build from.
.card {
display: inline-block;
vertical-align: top;
width: 150px;
height: 270px;
margin: 10px;
padding: 0;
border: 1px solid #444;
border-radius: 5px;
}
.image {
/* width is 100%, so 150px, by default */
height: 150px;
background-size: cover;
}
.text {
height: 150px;
margin-top: -40px;
}
.text > p {
max-height: 90px;
overflow: hidden;
text-overflow: ellipsis;
}
h1 {
margin: 0;
padding: 10px;
background: rgba(0, 0, 0, 0.7);
color: #eee;
font-size: 20px;
line-height: 20px;
}
p {
margin: 0;
padding: 10px;
font-size: 15px;
line-height: 20px;
}
<div class="card">
<div class="image"
style="background-image: url('http://lorempixel.com/150/150/abstract/');"></div>
<div class="text">
<h1>Foo</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec faucibus auctor odio, sed lobortis odio pellentesque tincidunt. Curabitur et libero maximus, consequat mi non, dignissim turpis.</p>
</div>
</div>
<div class="card">
<div class="image"
style="background-image: url('http://lorempixel.com/150/150/city/');"></div>
<div class="text">
<h1>Bar</h1>
<p>Sed ac lacus vel mi mollis ullamcorper quis ac sapien. Ut quis ornare ligula. Nullam a sapien eget arcu mattis aliquam. Quisque dapibus leo vel lacus rutrum sollicitudin.</p>
</div>
</div>
<div class="card">
<div class="image"
style="background-image: url('http://lorempixel.com/150/150/cats/');"></div>
<div class="text">
<h1>Baz</h1>
<p>Nullam eu urna dictum, gravida augue nec, dignissim enim. Duis sit amet elit quis mauris consectetur rhoncus et a ipsum. Fusce vel sagittis nulla, et imperdiet quam.</p>
</div>
</div>
You need to change your HTML and CSS to make it work properly.
<div class="background">
<div class="image" style="background-image: url('https://zero.eu/content/uploads/2017/01/Ryley_Walker-730x490.jpg');">
</div>
<div class="text">
<p>test test test</p>
</div>
</div>
then your CSS should look like this:
.background {
width: 360px;
height: 200px;
position: relative;
}
.image {
background-size: cover; /* that will keep the image in original ratio */
background-position: center center;
height: inherit;
}
.text {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 25%;
}
That will make an image to fully cover the background space and then the .text will be an overlay on the image. Actually, you could even skip the .image div, add background and the CSS to the .background div and it will work as well.
The example you provided features something different than your code is suggesting. If you want to achieve the look from example, then:
.background {
width: 360px;
height: 200px;
position: relative;
background: #fff;
}
.image {
background-size: cover; /* that will keep the image in original ratio */
background-position: center center;
position: relative;
}
.image:before {
content: "";
display: block;
padding-top: 60%; /* that will make a fixed ratio of you image box, even if you'll scale the background boc /*
}
.text {
/* actually it doesn't need styling in that case */
}
.background's parent {
display: flex; /* to make the blocks even in height without setting that as a fixed value */
}
Your code and the example you provided are doing different things. In order to get the effect of your example, you need more than one "card" (image and text together).
You can use display: flex on the .background div so that all the cards are the same height. Then you can add some margin to the cards so they are separated a little.
.background {
display: flex;
background: cyan;
}
.card {
width: 360px;
background: white;
margin: 10px;
}
.text {
padding: 0 5px;
}
.text p {
width:100%;
overflow: hidden;
}
<div class="background">
<div class="card">
<img src="https://zero.eu/content/uploads/2017/01/Ryley_Walker-730x490.jpg" width="360" height="200" class="wp-image-156 hoverZoomLink" alt="Willie Peyote Live"/>
<div class="text">
<p>test test test</p>
</div>
</div>
<div class="card">
<img src="https://zero.eu/content/uploads/2017/01/Ryley_Walker-730x490.jpg" width="360" height="200" class="wp-image-156 hoverZoomLink" alt="Willie Peyote Live"/>
<div class="text">
<p>another test</p>
</div>
</div>
<div class="card">
<img src="https://zero.eu/content/uploads/2017/01/Ryley_Walker-730x490.jpg" width="360" height="200" class="wp-image-156 hoverZoomLink" alt="Willie Peyote Live"/>
<div class="text">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque hendrerit, massa sed tristique lacinia, mauris lectus ultricies ipsum, vitae lobortis lectus arcu quis nisl. Etiam pulvinar porttitor mi, at aliquet quam mattis non.</p>
</div>
</div>
</div>

CSS Div Positioning After Absolute Div

What is the best way for me to resume the flow of the page in css.
Here is my situation:
I have 3 divs div 1(parent), div 1(child), and div 2(normal). parent div is absolute, child is relative. All is good so far. The problem i'm having is the the next normal div is shifted up to the same line as the absolute div (since i disrupted the flow of the page setting the parent div to absolute).
So my question is how do I put the normal div under the div that has the position of absolute. Do I just offset the margin-top property?
Thanks for all the help!
Take a look: https://jsfiddle.net/veLgmdt1/
If you know the height of the absolute-positioned element, it would be easy. Simply add padding / margin or placeholder div equal to the known height.
If the height is dynamic, you'd have to resort to jQuery/JavaScript.
Have a look at my demo which shows the default behaviour and the methods mentioned:
// get the absolute-positioned element
var abs = $("#dynamic .absolute");
// get height of absolute-positioned element
var absHeight = abs.height();
// insert placeholder div with height equal to absolute-positioned element
$("<div class='placeholder'></div>").height(absHeight).insertAfter(abs);
section {
position: relative;
padding: 1em;
margin: 1em;
border: 1px solid #CCC;
}
section div {
border: 1px dashed blue;
}
.absolute {
position: absolute;
top: 0; z-index: 1;
border:1px solid red;
height:50px;
}
#margin .absolute+div {
margin-top:50px;
}
#padding .absolute+div {
margin-top:50px;
}
.placeholder { height:50px; border:none }
#dynamic .absolute {
height:100px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<h3>Default Behaviour</h3>
<section>
<div class="absolute">position:absolute</div>
<div>normal div</div>
</section>
<h3>Known height: top margin</h3>
<section id="margin">
<div class="absolute">position:absolute</div>
<div>normal div with margin-top</div>
</section>
<h3>Known height: top padding</h3>
<section id="padding">
<div class="absolute">position:absolute</div>
<div>normal div with padding-top</div>
</section>
<h3>Known height: placeholder div</h3>
<section>
<div class="absolute">position:absolute</div>
<div class="placeholder"></div>
<div>normal div</div>
</section>
<h3>Dynamic height: JavaScript/jQuery</h3>
<section id="dynamic">
<div class="absolute">position:absolute</div>
<div>normal div</div>
</section>
jsFiddle: https://jsfiddle.net/azizn/mq6bejhf/
http://jsfiddle.net/veLgmdt1/6
Simplified HTML structure by using rows and floated columns. This will eliminate need for margin and absolute positioning.
<div class="content-wrapper">
<div class="row">
<div class="col col-lg-3">
<img src="http://lorempixel.com/230/230/" class="img-rounded">
<button class="btn btn-primary">Invite To Project</button>
<ul class="list-unstyled">
<li>Member Since: July 21, 2016</li>
<li>Toronto, ON</li>
<li>
<ul class="list-inline">
<li>Social:</li>
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-pinterest"></i></li>
<li><i class="fa fa-google-plus"></i></li>
<li><i class="fa fa-youtube"></i></li>
</ul>
</li>
</ul>
</div>
<div class="col col-lg-9">
<h2 class="profile-name">John Doe</h2>
<h4 class="">Graphic Designer</h4>
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
</div>
</div>
<div class="row">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active">Home <span class="badge">42</span></li>
<li role="presentation">Profile</li>
<li role="presentation">Messages <span class="badge">3</span></li>
</ul>
</div>
</div>
CSS
.content-wrapper {
width: 1000px;
margin: 0 auto;
}
.row {
width: 100%;
padding-top: 20px;
}
.row:nth-child(odd) {
background-color: #f5f5f5;
border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #DDDDDD;
}
.col {
float: left;
}
.col-lg-3 {
width: 25%
}
.col-lg-9 {
width: 75%
}
.profile-heading {
margin-top: 50px;
background-color: #f5f5f5;
border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #DDDDDD;
}
.profile-heading > .panel {
position: relative;
background-color: inherit;
margin: 0 auto;
width: 1000px;
border: none;
}

Footer positioning with absolute positioned content

I've made a codepen at http://codepen.io/anon/pen/vNVMRE
I know how to make a sticky footer.
However, in my case my content (.moveDown) needs to be positioned absolute, because of that the footer doesn't stick at the bottom.
You can check that in the codepen. If you make the window smaller until you have scroll bars, the footer moves over the content and stays in the new position;
Of course I could make the .movedown div relative by changing the code on line 40 & 41 to
position: relative;
top: 0;
But then my mobile version gets problems.
I have made a simplified version # http://lettherobots.be/test2/
As you can see, the footer works until there's a scroll bar.
If you scale the window to max-size 460 there's a vertical menu which can be accessed through the hamburger.
If I make the position of the content wrapper (.moveDown) relative, then the links in my vertical navigation become inactive. I have tried fixing that with z-index, but that didn't solve the problem.
Any idea how I can get this fixed? How I can get a footer at the end of my documents even if the content of the page
Some of the code:
Html:
<body>
<div class="container">
<div class="navContainer">
<nav class="horizontalNav">
....
</nav>
<nav class="verticalNav" id="verticalMenu">
...
</nav>
</div>
<div class="content moveDown clearfix">
<header>
<img src="images/headerPic.jpg" alt="Header picture">
</header>
<div class="htmlWrapper">
{$importedContent}
</div>
</div>
<footer>bla bla</footer>
</div>
CSS
.moveDown {
left: 0;
margin: 0 auto;
padding: 0;
position: absolute;
right: 0;
top: 60px;
width: 100%;
z-index: -2;
-webkit-transition: top 300ms ease;
-moz-transition: top 300ms ease;
-o-transition: top 300ms ease;
-ms-transition: top 300ms ease;
transition: top 300ms ease;
}
You can't stick only with position:absolute, because absolute elements is positioned according to first parent relative element. You can fix at the bottom of some div, but it is static, so it can't move according to scroll. There is an excelent explanation at CSS-tricks where you can see this differentes.
See this example below:
html{
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
position: relative;
}
html {
height: 100%;
}
.clearfix::after,
section::after,
header::after,
footer::after {
clear: both;
content: " ";
display: block;
font-size: 0;
height: 0;
visibility: hidden;
}
.container {
min-height: 100%;
position: relative;
}
.navHorizontal {
height: 60px;
text-align: right;
background-color: #eee;
}
nav.navHorizontal a {
display: inline-block;
}
.content {
padding-bottom: 100px;
position: absolute;
top:60px;
width: 100%;
}
header img {
width: 100%;
height: 100px;
}
footer {
background-color: #ddd;
position: absolute;
bottom: 0;
height: 100px;
width: 100%;
}
<div class="container">
<div class="navContainer">
<nav class="navHorizontal">
<section>
<div class="linkSection">
Home
Portfolio
Tutorials
Contact
</div>
</section>
</nav>
</div>
<div class="content clearfix">
<header>
<img src="http://placehold.it/200x100">
</header>
<div>
<h1>Some text here</h1>
</div>
<div>
Aliquam hendrerit at est sit amet imperdiet. Etiam nisi eros, sollicitudin ac ligula a, dignissim gravida purus. Mauris non lectus id ex ultricies iaculis nec nec magna. Praesent maximus eleifend sapien. Nunc lobortis ante id leo faucibus ullamcorper.
Phasellus fringilla posuere urna, ut porttitor nisi.
</div>
<div>
Aliquam hendrerit at est sit amet imperdiet. Etiam nisi eros, sollicitudin ac ligula a, dignissim gravida purus. Mauris non lectus id ex ultricies iaculis nec nec magna. Praesent maximus eleifend sapien. Nunc lobortis ante id leo faucibus ullamcorper.
Phasellus fringilla posuere urna, ut porttitor nisi.
</div>
<footer>Footer Content</footer>
</div>
</div>

Text position coming from bottom

Basically I have a title inside an image. As you can notice from the code and example below, I've set a negative margin-top to position it inside the image, near the bottom. The problem is that the text position/orientation is from top to bottom. Meaning that the more text the title has, the longer it will be, towards the bottom. I want to make it reverse - so that the text div expands the text towards the top, according to its size.
Is it possible? Thank you in advance.
Here is the example http://jsfiddle.net/j7gLd/
HTML
<div class="image">
<img src="image.jpg">
<div class="title">This is a title</div>
</div>
<div class="image">
<img src="image.jpg">
<div class="title">This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title</div>
</div>
CSS
.image {
width: 800px;
height: 530px;
margin: 10px;
}
.title {
position: absolute;
background-color: #CCC;
max-width: 600px;
margin-top: -80px;
padding: 5px;
}
Here is what you are looking for, give .image position:relative and .title bottom:0; fiddle
<div class="image">
<img src="http://s23.postimg.org/g033nno17/image.jpg"/>
<div class="title">This is a title Maurizzle pellentesque nibh black turpizzle. Doggy izzle tortizzle. Pellentesque eleifend rhoncus crunk. In hac habitasse funky fresh dictumst. Donec dapibizzle. Curabitizzle tellizzle fo shizzle my nizzle, pretizzle own yo', that's the shizzle away, shizznit vitae, nunc. Stuff suscipit. Dawg sempizzle velit sizzle pizzle.</div>
</div>
<div class="image" style="background:red;">
<img src="http://s23.postimg.org/g033nno17/image.jpg"/>
<div class="title">This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a title This is a titl Lorizzle ipsizzle dolor crunk amizzle, consectetizzle adipiscing get down get down. Mofo dawg velizzle, shiz volutpat, suscipit quis, gravida vel, pimpin'. Pellentesque eget tortor. Sed erizzle. Dope at dapibizzle away tempus shiz. Maurizzle pellentesque nibh black turpizzle. Doggy izzle tortizzle. Pellentesque eleifend rhoncus crunk. In hac habitasse funky fresh dictumst. Donec dapibizzle. Curabitizzle tellizzle fo shizzle my nizzle, pretizzle own yo', that's the shizzle away, shizznit vitae, nunc. Stuff suscipit. Dawg sempizzle velit sizzle pizzle.e</div>
</div>
.image {
width: 820px;
height: 530px;
margin: 10px;
position:relative;
}
.title {
position: absolute;
display:block;
background-color: #CCC;
padding: 5px;
bottom:0;
width:790px;
vertical-align:bottom;
}
Set the title to position:absolute;bottom:0;
May i suggest you something different?
Have a look on this fiddle.
Also added hover to see the title.
HTML
<div class="image" style="background-image: url('http://placekitten.com/200/150');">
<div class="footerBar">Small Title</div>
</div>
<div class="image" style="background-image: url('http://placekitten.com/200/150');">
<div class="footerBar">Very Very Very Very Very Very Very Very Very Very Very Very Very Long Title</div>
</div>
CSS
.image {
width: 200px;
height: 150px;
position: relative;
}
.footerBar {
background-color: lightGrey;
position: absolute;
bottom: 0px;
width: 100%;
overflow: none;
display: none;
word-wrap:break-word;
}
.image:hover .footerBar {
display: block;
}
Is vertical-align what you are looking for?