Responsive divs with and image in each - css

I am trying to done is have a responsive div with 2 pictures centered, one in each div.
What I am want it is to drop down, when the screen is small and not big enought to display them side by side.
At the moment with the below when the screen is smaller it pushes the images into each other.
<style>
.container{width:100%}
.inner_container{float:left;width:50%;}
.img_container{width:250px;margin:0 auto:padding-bottom:5px;}
</style>
<div class="container">
<div class="inner_container">
<div class="img_container">
<img src="left_img.png" width="250" height="70" alt="" border="0">
</div>
</div>
<div class="inner_container">
<div class="img_container">
<img src="right_img.png" width="250" height="70" alt="" border="0">
</div>
</div>
</div>

You're using the wrong styles to do what you're trying to do. Mainly, you've set a fixed width of 250px to your img_container div which is why the images aren't getting scaled down. This the correct way to achieve what you want:
.container {
width: 100%
}
.inner_container {
width: 49%;
display: inline-block;
}
.img_container {
width: 100%;
}
.img_container a img {
width: 100%;
}
<div class="container">
<div class="inner_container">
<div class="img_container">
<a href="http://www.google.co.uk">
<img src="http://lorempixel.com/400/200/" width="250" height="70" alt="" border="0">
</a>
</div>
</div>
<div class="inner_container">
<div class="img_container">
<a href="http://www.google.com">
<img src="http://lorempixel.com/400/200/" width="250" height="70" alt="" border="0">
</a>
</div>
</div>
</div>
With the above code, the images keep on getting scaled down and stay on the same line until the window size is reduced to very small. If you would want them to appear on two separate lines after a particular width, you will need to use media-queries like this:
.container{width:100%}
.inner_container { width: 49%; display: inline-block; }
.img_container { width: 100%; }
.img_container a img { width: 100%; }
#media (max-width: 650px) {
.inner_container { width: 100%; display: block; }
}
<div class="container">
<div class="inner_container">
<div class="img_container">
<img src="http://lorempixel.com/400/200/" width="250" height="70" alt="" border="0">
</div>
</div>
<div class="inner_container">
<div class="img_container">
<img src="http://lorempixel.com/400/200/" width="250" height="70" alt="" border="0">
</div>
</div>
</div>

Set a min-width on the .inner_container
.container {
width:100%;
overflow: hidden;
}
.inner_container {
float:left;
width:50%;
min-width: 250px;
}
.img_container {
width:250px;
margin:0 auto;
padding-bottom:5px;
text-align: center;
}
http://jsfiddle.net/63pnotjc/

When I posted my reply, I didn't notice Fahad, Show code snippet link.
Thank you both for your help, this is the css code I went with in the end.
.container{width:100%;overflow:hidden;}
.inner_container{display:inline-block;width:49%;}
.img_container{width:250px;margin:0 auto;text-align:center;padding-bottom:5px;}
#media (max-width:501px){
.inner_container{display:block;width:100%;}
}
Once again thank you both for your help :)

Related

How to Keep divs in CSS Gallery in Line, or All The Same Size or Both?

I am working with the code below from w3schools to make a gallery. The problem I have is that if one item has a rather long description it causes the items below to become disordered and not line up properly.
As far as I can tell this can be solved by making the item boxes either all the same height or by having a set gap between each row from the bottom of the tallest on the top row to the top of all three on the bottom row. I do not know how to do either of these.
div.gallery {
margin: 5px;
border: 1px solid #ccc;
float: left;
width: 180px;
}
div.gallery:hover {
border: 1px solid #777;
}
div.gallery img {
width: 100%;
height: auto;
}
div.desc {
padding: 15px;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div style="overflow: hidden;">
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_5terre.jpg">
<img src="https://www.w3schools.com/css/img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</a>
<div class="desc">Add a description of the image here and make it really long to see what happens</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_forest.jpg">
<img src="https://www.w3schools.com/css/img_forest.jpg" alt="Forest" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_lights.jpg">
<img src="https://www.w3schools.com/css/img_lights.jpg" alt="Northern Lights" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_mountains.jpg">
<img src="https://www.w3schools.com/css/img_mountains.jpg" alt="Mountains" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
</div>
</body>
</html>
Does anyone have a solution to how they can be kept inline neatly?
display:flex offers a really neat way to organise items like this. You can have everything stretch to the same height as the tallest item in it's row, or you can align them in a bunch of different ways with only a few lines of code to the parent container.
For more info: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
.gallery-container {
display: flex;
align-items: stretch;
flex-wrap: wrap;
}
div.gallery {
margin: 5px;
border: 1px solid #ccc;
/*float: left;*/
width: 180px;
}
div.gallery:hover {
border: 1px solid #777;
}
div.gallery img {
width: 100%;
height: auto;
}
div.desc {
padding: 15px;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="gallery-container">
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_5terre.jpg">
<img src="https://www.w3schools.com/css/img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</a>
<div class="desc">Add a description of the image here and make it really long to see what happens</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_forest.jpg">
<img src="https://www.w3schools.com/css/img_forest.jpg" alt="Forest" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_lights.jpg">
<img src="https://www.w3schools.com/css/img_lights.jpg" alt="Northern Lights" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_mountains.jpg">
<img src="https://www.w3schools.com/css/img_mountains.jpg" alt="Mountains" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
</div>
</body>
</html>
The answer above works well and I want to add one more thing to it. If you want to align the description vertically, you can again use the Flexbox. I have added it in the CSS code here.
.gallery-container {
display: flex;
align-items: stretch;
flex-wrap: wrap;
}
div.gallery {
margin: 5px;
border: 1px solid #ccc;
width: 180px;
/* To align the description both horizontally and vertically*/
display: flex;
flex-direction: column;
justify-content: center;
align-items:center;
}
div.gallery:hover {
border: 1px solid #777;
}
div.gallery img {
width: 100%;
height: auto;
}
div.desc {
padding: 15px;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="gallery-container">
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_5terre.jpg">
<img src="https://www.w3schools.com/css/img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</a>
<div class="desc">Add a description of the image here and make it really long to see what happens</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_forest.jpg">
<img src="https://www.w3schools.com/css/img_forest.jpg" alt="Forest" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_lights.jpg">
<img src="https://www.w3schools.com/css/img_lights.jpg" alt="Northern Lights" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="https://www.w3schools.com/css/img_mountains.jpg">
<img src="https://www.w3schools.com/css/img_mountains.jpg" alt="Mountains" width="600" height="400">
</a>
<div class="desc">Add a description of the image here</div>
</div>
</div>
</body>
</html>

How to remove blank between div?

I have a problem with CSS.
.special-banner{
width: 100vw;
position: relative;
}
.special-banner > img{
width: 100%;
height: 100%;
}
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_01_renew.png"/>
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_02_renew.png"/>
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_03_renew.png"/>
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_04_renew.png"/>
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_05_renew.png"/>
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_06_renew.png"/>
</div>
As you can see, there are some White line.
I want to remove them.
Also, I have 1 solution.
Using display: flex.
It's efficient but I can't use that.
Do you have another solution?
I guess it causes with display:block..
I don't know if you added display:block or not, but putting it in the img style removes the white line
.special-banner {
width: 100vw;
position: relative;
}
.special-banner>img {
width: 100%;
height: 100%;
display: block;
}
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_01_renew.png" />
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_02_renew.png" />
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_03_renew.png" />
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_04_renew.png" />
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_05_renew.png" />
</div>
<div class="special-banner">
<img src="http://wanho1108.dothome.co.kr/hmb/web/n_himages/sub/sub_point_use_banner_06_renew.png" />
</div>
try applying float:left for .special-banner and .special-banner > img
.special-banner,.special-banner > img{
float: left;
}

Change position of Images HTML when Window changes

This is probably much easier than I'm making it sound.
Basically I have 6 Images, each with a button underneath...
This is what it looks like:
I just place them like this:
<img src="Image.png" width="350" height="208" style="margin: 0px 16px">
<img src="Image.png.png" width="350" height="208" style="margin: 0px 16px">
<img src="Button.png" width="282" height="84" style="margin: 0px 16px">
<img src="Button.png" width="282" height="84" style="margin: 0px 16px">
It looks great on a typical browser window. But when I make the window narrower, it goes like this:
Which makes sense give how I list my images/buttons.
But I want them to look like this when the window is narrowed:
What can I add to my very basic HTML to keep this in a nice and format no matter how wide the window is?
Ideally I'd like to go from a 2 by x grid as max, down to a 1 by x grid as seen in the first and final images.
A push in the right direction would be amazing.
I did look HERE on Stackoverflow, but it's far more complex as only works with squares.
I look forward to your help :D
UPDATE
https://jsfiddle.net/du6Lu4ge/
looks like this:
when resized, looks like this:
:(
I would do something like this:
https://jsfiddle.net/du6Lu4ge/3/
Hope it helps you out!
What I did was to wrap the image and the button in a div .img-wrapper styled with display: inline-block
this example is working full responsive, you can simply edit the css and add viewports.
html:
<div class="imageContainer">
<div class="imageBlock">
<!--<img class="image" src="image.png">-->
<div class="image">
your image
</div>
</div>
<div class="buttonBlock">
<!--<img class="button" srck="button.png">-->
<div class="button">
your button
</div>
</div>
</div>
<div class="imageContainer">
<div class="imageBlock">
<!--<img class="image" src="image.png">-->
<div class="image">
your image
</div>
</div>
<div class="buttonBlock">
<!--<img class="button" srck="button.png">-->
<div class="button">
your button
</div>
</div>
</div>
<div class="imageContainer">
<div class="imageBlock">
<!--<img class="image" src="image.png">-->
<div class="image">
your image
</div>
</div>
<div class="buttonBlock">
<!--<img class="button" srck="button.png">-->
<div class="button">
your button
</div>
</div>
</div>
<div class="imageContainer">
<div class="imageBlock">
<!--<img class="image" src="image.png">-->
<div class="image">
your image
</div>
</div>
<div class="buttonBlock">
<!--<img class="button" srck="button.png">-->
<div class="button">
your button
</div>
</div>
</div>
css:
.imageContainer {
width: 400px;
display: inline-block;
}
.imageContainer .imageBlock {
display: inline-block;
}
.imageContainer .imageBlock .image {
display: inline-block;
width: 400px;
height: 300px;
background-color: darkred;
}
.imageContainer .buttonBlock {
display: inline-block;
text-align: center;
}
.imageContainer .buttonBlock .button {
display: inline-block;
width: 300px;
margin: 10px 50px; /* simple way to center it */
height: 100px;
background-color: cyan;
}
you can test it on https://jsfiddle.net/q10fbesm/
edit: if you need a 2 line grid, simply put a container arround this html, style it with max-widht: 801px;

Change content on hovering, only by CSS

I have seen many different ways to resolve the following, but it does not work quite as I hoped...
I need to make a div (main div) with severel divs inside (item-divs).
Each item-div must show a different picture, but when I hover a certain picture, this picture should be hidden and a text showen instead - in the same div.
How on earth can I make this?
For example this variant:
<div class="wrap">
<div class="child1"></div>
<div class="child2"></div>
</div>
And your css chould be:
.wrap:hover > child2{
opacity: 0;
}
But static styles should be like this:
.wrap{
width: 200px;
height: 300px; /* maybe auto if you want */
position: relative;
}
.child1{
width: 100%;
height: 100%;
background: lightgreen;
}
.child2{
width: 100%;
height: 100%;
background: #ff3030; /* surely for example */
position: absolute;
top: 0;
left: 0;
}
/* and this block .child2 will be faced. When it's opacity will be 0, you get your effect */
You can do this with the CSS pseudo element :hover
See example:
http://jsbin.com/vijawuda/1/edit?html,css,output
HTML Markup:
<div class='outer-container'>
<div class='image-holder'>
<img src='' />
<div class='text'>
Test image 1
</div>
</div>
<div class='image-holder'>
<img src='' />
<div class='text'>
Test image 2
</div>
</div>
<div class='image-holder'>
<img src='' />
<div class='text'>
Test image 3
</div>
</div>
<div class='image-holder'>
<img src='' />
<div class='text'>
Test image 4
</div>
</div>
<div class='image-holder'>
<img src='' />
<div class='text'>
Test image 5
</div>
</div>
</div>
CSS
.image-holder {
width: 150px;
height: 150px;
display: inline-block;
}
.image-holder > .text {
visibility: hidden;
width: 150px;
height: 150px;
}
.image-holder:hover img {
visibility: hidden;
}
.image-holder:hover .text {
visibility: visible;
}
HTML
<div class="main">
<div class="content">
<div class="maincontent">
<img src="http://lorempixel.com/150/150/" alt="" height="150" width="150" />
</div>
<div>Hovering Content</div>
</div>
<div class="content">
<div class="maincontent">
<img src="http://lorempixel.com/150/150/" alt="" height="150" width="150" />
</div>
<div>Hovering Content</div>
</div>
<div class="content">
<div class="maincontent">
<img src="http://lorempixel.com/150/150/" alt="" height="150" width="150" />
</div>
<div>Hovering Content</div>
</div>
<div class="content">
<div class="maincontent">
<img src="http://lorempixel.com/150/150/" alt="" height="150" width="150" />
</div>
<div>Hovering Content</div>
</div>
<div class="content">
<div class="maincontent">
<img src="http://lorempixel.com/150/150/" alt="" height="150" width="150" />
</div>
<div>Hovering Content</div>
</div>
</div>
CSS
.main {
width: 1000px;
height: 200px;
}
.content {
width: 150px;
height: 150px;
background-color:#c80000;
color:#fff;
font-family:arial;
text-align:center;
float:left;
margin-left: 10px;
font-size: 20px;
cursor:pointer;
}
.content > div.maincontent + div {
display:none;
padding-top:50px;
}
.content:hover > div.maincontent {
display:none;
}
.content:hover > div.maincontent + div {
display:block;
}
http://jsfiddle.net/q92zL/4/

Images floating off footer

I have a position:fixed footer on my page so that it scrolls with the page. Inside that footer I have a set of five images. The problem is that the images all hang off the bottom of the footer so the bottoms are not visible. No margin or padding values have moved them to the appropriate place on screen. Is there a css command I am missing or is their something weird with the footer?
This is the css for the footer and images within it. Thanks for any help.
.footer {
background-color: rgba(0, 0, 0, 0.5);
height: 100px;
font-size:20px;
color:black;
font-family:Verdana;
padding-left: 8px;
width: 100%;
position:fixed; left:0px; bottom:100px;
}
.footer img{
width: 59px;
height: 90px;
float: right;
display:inline;
padding: 1px;
margin-right: 50px;
}
<body>
<div class="container">
<div class="header"></div>
<div class="content">
<div class="leftSidebar">
<div align="center">
<h3>Quick Stats</h3>
</div>
<p>Title: Exposure</p>
<p>Author: Kathy/Brendan Reichs</p>
<p>Series: Virals</p>
<p>Length: 436 pages</p>
<p>Publication Date: March 6, 2014 </p>
<p align="center"><img src="../Images/Barnes-and-Noble.png" width="180" height="120" /><img src="../Images/amazon.png" width="180" height="98.18" style="z-index: -1;" /></p>
</div>
<div class="rightSidebar">
<div align="center">
<h3>Kathy Reichs</h3>
</div>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br><br>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</br></p>
</div>
<div class="middleBar">
<div class="bookTitle" align="center">
<h1>Virals: Exposure</h1>
<h2 style="font-size:24px;">Kathy and Brendan Reichs</h2>
</div>
<div align="center"><img name="" src="../Exposure.jpg" width="315" height="456" alt="" /></div>
</div>
</div>
<div class="footer">
<div class="relatedBooks">
<p>Related Books: ssssss </p>
</div>
<div class="footerImages">
<img src="../Images/Swipe.jpg" width="1000" height="1500" />
<img src="../Images/Code.jpg" width="59" height="90" />
<img src="../Images/Shift.jpg" width="1000" height="1500" />
<img src="../Images/Seizure.jpg" width="327" height="500" />
<img src="../Images/Virals.jpg" width="327" height="500" />
</div>
</div>
</div>
</body>
Just delete the "height: 100px;". It will be set to auto then, and if you want some more space around the images then use something like "padding: 24px 0;" to space it out a bit. There's no reason to declare the height of the footer. It will auto-grow to the size of your images. I imagine that's why they're floating off.

Resources