aligning multiple div, img and text in CSS - problems - css

I'm trying to align several DIVS, Images and text and I can't figure this out..
Here's what I'm trying to achieve:
Heres' my HTML
<div class="section5">
<div class="outer">
<div class="container1">
<img src="icon.png" width="85">
<div class="title1">Text</div>
<div class="subtitle1">Text</div>
</div>
<div class="container2">
<img src="iphone.png" width="375">
<div class="subtitle2">Text</div>
</div>
</div>
</div>
Here is my CSS:
.section5{ height: 525px; background-color: #5e6172; text-align: center; position: relative;}
.outer{ width: 80%; background-color: #45da45; height: 100%; margin: 0 auto; position: relative;}
.title1{color: #ffffff; font-size: 2.6em; font-family: h35; }
.subtitle1{color: #ffffff; font-size: 1.5em; font-family: h35; margin-top: 0.25em; }
.subtitle2{color: #ffffff; font-size: 1.5em; font-family: h35; margin-top: 0.25em; }
.container1{display: block; background-color: #ccc; }
.container2{display: block; background-color: #fffc1e; }
Here is the JSFIDDLE:
http://jsfiddle.net/mib92/hogwohf8/
My current problems:
1) My text at the bottom needs to be on the right side of the image.. center like in my example image.
2) the bottom of my bottom picture must be align to the bottom of container2 AND the bottom of section5
3) While doing this, the container 1 must remain in the vertical middle of the remaining space of the section5.
Thank you

I hops it's help you.
.section5 {
height: 525px;
background-color: #5e6172;
text-align: center;
position: relative;
}
.outer {
width: 80%;
background-color: #45da45;
height: 100%;
margin: 0 auto;
position: relative;
}
.title1 {
color: #ffffff;
font-size: 2.6em;
font-family: h35;
}
.subtitle1 {
color: #ffffff;
font-size: 1.5em;
font-family: h35;
margin-top: 0.25em;
}
.subtitle2 {
color: #ffffff;
font-size: 1.5em;
font-family: h35;
margin-top: 0.25em;
}
.container1 {
display: block;
background-color: #ccc;
}
.container2 {
display: block;
background-color: #fffc1e;
}
.right-sied {
display: inline-block;
vertical-align: top;
width: 41%;
}
.left-sied {
display: inline-block;
width: 49%;
}
.left-sied img {
max-width: 100%;
}
<div class="section5">
<div class="outer">
<div class="container1">
<img src="icon.png" width="85">
<div class="title1">Text</div>
<div class="subtitle1">Text</div>
</div>
<div class="container2">
<div class="left-sied">
<img src="iphone.png" width="375">
</div>
<div class="right-sied">
<div class="subtitle2">Text</div>
</div>
</div>
</div>
</div>
Live Demo

check this:
.section5 {
height: 525px;
background-color: #5e6172;
text-align: center;
position: relative;
}
.outer {
width: 80%;
background-color: #45da45;
height: 100%;
margin: 0 auto;
position: relative;
}
.title1 {
color: #ffffff;
font-size: 2.6em;
font-family: h35;
}
.subtitle1 {
color: #ffffff;
font-size: 1.5em;
font-family: h35;
margin-top: 0.25em;
}
.subtitle2 {
color: #ffffff;
font-size: 1.5em;
font-family: h35;
margin-top: 0.25em;
}
.container1 {
display: block;
background-color: #ccc;
}
.container2 {
display: block;
background-color: #fffc1e;
}
.container1 .wrapper {
display: inline-block;
float: right;
}
.container2 img {
margin: 0 auto;
}
<div class="section5">
<div class="outer">
<div class="container1">
<img src="http://images.all-free-download.com/images/graphiclarge/daisy_pollen_flower_220533.jpg" width="85">
<div class="wrapper">
<div class="title1">Text</div>
<div class="subtitle1">Text</div>
</div>
</div>
<div class="container2">
<div class="subtitle2">Text</div>
<img src="http://images.all-free-download.com/images/graphiclarge/daisy_pollen_flower_220533.jpg" width="375">
</div>
</div>
</div>

Related

Dropdown div doesn't push down the content

I've got a dropdown from header div which has to push down the content(e.g. when you click This is Icon it appears Blue dropdown which has to push down h1 tags).
The problem is the height of two classes(header-bar__top, header-bar) which I can't change and I need them to be the same height. Is there a way to do that?
I can manipulate only these classes: .header-bar-mobile-drop-down__container, .header-bar-mobile-drop-down__item, .header-bar-mobile-drop-down__icon-button
.header-bar-mobile-drop-down__container {
color: #fff;
display: block;
font-size: 16px;
line-height: 1.5rem;
cursor: pointer;
}
.header-bar-mobile-drop-down__item {
display: none;
align-items: center;
text-align: center;
}
.header-bar-mobile-drop-down__icon-button {
color: #fff;
border: none;
background-color: transparent;
font-size: 1.5rem;
}
.header-bar-mobile-drop-down__icon-button:focus+.header-bar-mobile-drop-down__item {
display: block;
margin-top: 26px;
height: 68px;
color: black;
background-color: blue;
}
.header-bar {
height: 3.5rem;
box-shadow: none;
background-color: orange;
}
.header-bar__top {
height: 3.5rem;
z-index: 100;
}
.header-bar__container {
position: relative;
height: 100%;
margin-right: auto;
margin-left: auto;
max-width: 1152px;
}
.header-bar__container:after {
content: "";
display: table;
clear: both;
}
<div>
<div class="header-bar">
<div class="header-bar__top">
<div class="header-bar__container">
<div class="header-bar-mobile-drop-down__container">
<button class="header-bar-mobile-drop-down__icon-button" tabindex="1">
This is Icon
</button>
<div class="header-bar-mobile-drop-down__item">
This is my drop down
</div>
</div>
</div>
</div>
</div>
<h1>This need to be pushed down</h1>
<h1>But instead</h1>
<h1>The dropdown is getting overlayed</h1>
</div>
use min-height instead of height on the header bar and header bar top otherwise it will stay the same height and the drop down will be show as overflow (which is why the content below doesn't move)
.header-bar-mobile-drop-down__container {
color: #fff;
display: block;
font-size: 16px;
line-height: 1.5rem;
cursor: pointer;
}
.header-bar-mobile-drop-down__item {
display: none;
align-items: center;
text-align: center;
}
.header-bar-mobile-drop-down__icon-button {
color: #fff;
border: none;
background-color: transparent;
font-size: 1.5rem;
}
.header-bar-mobile-drop-down__icon-button:focus+.header-bar-mobile-drop-down__item {
display: block;
margin-top: 26px;
height: 68px;
color: black;
background-color: blue;
}
.header-bar {
min-height: 3.5rem;
box-shadow: none;
background-color: orange;
}
.header-bar__top {
min-height: 3.5rem;
z-index: 100;
}
.header-bar__container {
position: relative;
height: 100%;
margin-right: auto;
margin-left: auto;
max-width: 1152px;
}
.header-bar__container:after {
content: "";
display: table;
clear: both;
}
<div>
<div class="header-bar">
<div class="header-bar__top">
<div class="header-bar__container">
<div class="header-bar-mobile-drop-down__container">
<button class="header-bar-mobile-drop-down__icon-button" tabindex="1">
This is Icon
</button>
<div class="header-bar-mobile-drop-down__item">
This is my drop down
</div>
</div>
</div>
</div>
</div>
<h1>This need to be pushed down</h1>
<h1>But instead</h1>
<h1>The dropdown is getting overlayed</h1>
</div>
If you can't change the height of the two classes, then I would move the drop down outside the header and use a checkbox toggle instead:
.header-bar-mobile-drop-down__container {
color: #fff;
display: block;
font-size: 16px;
line-height: 1.5rem;
cursor: pointer;
}
.header-bar-mobile-drop-down__icon-button {
color: #fff;
border: none;
background-color: transparent;
font-size: 1.5rem;
cursor: pointer;
}
#dropdown-toggle {
display: none;
}
.header-bar-mobile-drop-down__item {
display: none;
align-items: center;
text-align: center;
height: 68px;
color: black;
background-color: blue;
}
#dropdown-toggle:checked+.header-bar-mobile-drop-down__item {
display: block;
}
.header-bar {
height: 3.5rem;
box-shadow: none;
background-color: orange;
}
.header-bar__top {
height: 3.5rem;
z-index: 100;
}
.header-bar__container {
position: relative;
height: 100%;
margin-right: auto;
margin-left: auto;
max-width: 1152px;
}
.header-bar__container:after {
content: "";
display: table;
clear: both;
}
<div>
<div class="header-bar">
<div class="header-bar__top">
<div class="header-bar__container">
<div class="header-bar-mobile-drop-down__container">
<label for="dropdown-toggle" class="header-bar-mobile-drop-down__icon-button" tabindex="1">
This is Icon
</label>
</div>
</div>
</div>
</div>
<input id="dropdown-toggle" type="checkbox">
<div class="header-bar-mobile-drop-down__item">
This is my drop down
</div>
<h1>This need to be pushed down</h1>
<h1>But instead</h1>
<h1>The dropdown is getting overlayed</h1>
</div>

Design help using css

I need to achieve a nice 2 column layout as shown in
So far i could get only: https://jsfiddle.net/8qskxqfh/
code in fiddle link
Could you please suggest me on improving this design.
.myRatingBoxRed {
display: inline-block;
width: 15px;
height: 15px;
background-color: red;
}
.myRatingBoxYellow {
display: inline-block;
width: 15px;
height: 15px;
background-color: yellow;
}
.myRatingBoxGreen {
display: inline-block;
width: 15px;
height: 15px;
background-color: green;
}
.myResourceViewBody {
width: 960px;
position: relative;
margin: 0 auto;
}
.myResourceViewBody.myResourceSideBar {
position: absolute;
left: 0;
width: 240px;
height: 100%;
min-height: 800px;
color: #fff;
}
.myResourceViewInfo {
background: #fff;
padding-left: 300px;
}
.myResourceViewInfo .section-title {
text-transform: uppercase;
font-size: 20px;
font-weight: 500;
color: #2d7788;
position: relative;
margin-top: 0;
margin-bottom: 20px;
}
.myResourceViewInfo .attributes-section .item {
margin-bottom: 15px;
}
.h2.myResourceTitle {
font-weight: bold;
background: #9A3324 none repeat scroll 0px 0px;
width: 66%;
padding-left: 5px;
color: #FFF;
font-size: 18px;
vertical-align: middle;
display: inline-block;
position: relative;
height: 50px;
padding-top: inherit;
margin-top: 4px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.myResourceViewBody ul {
font-size: 1.2em;
font-weight: bold;
list-style-type: none;
margin-left: 300px;
padding: 0 0 0 10px;
}
<div id="myResourceHeader">
<h2 class="header-title myResourceTitle">Test article 1</h2>
</div>
<div class="myResourceViewBody">
<div class="myResourceSideBar">
<div class="myImageBox"></div>
<div class="myEvaluationArea">
<div class="myRatingBoxRed"></div>
<div class="myRatingBoxYellow"></div>
<div class="myRatingBoxGreen"></div>
</div>
</div>
<div class="myResourceViewInfo">
<h2 class="myViewInfo section-title"><i class="fa icon-info-sign"></i>Description</h2>
<ul>
<li>demo 1</li>
<li>demo 2</li>
</ul>
</div>
</div>
<div class="myResourceViewFooter"></div>
Check example below:
.row {
display: table;
width: 100%;
}
.row:after {
clear: both;
}
.col {
display: table-cell;
border: 1px solid red;
}
.width-70 {
width: 70%;
}
.width-30 {
width: 30%;
}
<div class="row">
<div class="col width-30">
col1
</div>
<div class="col width-70">
col2
</div>
</div>
Try using col-spans inside row
something like this
<div class="row">
<div class="col-md-6">
//first column
</div>
<div class="col-md-6">
// second column
</div>
</div>
refer to bootstrap classes for more details and how to make it responsive also.

Text stuck in middle of div instead of far left

As you can see i goes straight to the middle instead of the starting point of the div. I have set a margin and width for my div and when I do input an <H1> tag, the text just floats to the middle of the div instead of the far left where the div begins. I have set the width so it can start at that starting point not 45px to the left.
This is the HTML
<div id="topbar">
<div id="logo"> <img src="Pictures/bbc.png"> </div>
<div id="signin" class="border-part"> </div>
<div> <img id="logo-image" src="Pictures/signin.png">
<p class="signin-text">Sign in</p>
</div>
<div id="dash"> <img id="dash-image" src="Pictures/bash2.png"> </div>
<div> <img id="bell"src="Pictures/bell3.png"> </div>
<div class="border-part stuff-section"> News </div>
<div class="border-part stuff-section"> Sport </div>
<div class="border-part stuff-section"> Weather </div>
<div class="border-part stuff-section"> iPlayer </div>
<div class="border-part stuff-section"> TV </div>
<div class="border-part stuff-section"> Radio </div>
<div class="border-part stuff-section"> More </div>
<div class="seacher-border">
<input id="search-box" type="text" placeholder="Search">
<img id="search-pic" src="Pictures/search.png"> </div>
</div>
<div id="second-bar">
<div id="newsbar">
<h1>NEWS</h1>
</div>
</div>
This is my CSS
#topbar {
width: 1080px;
margin: 0 auto;
height: 40px;
}
body {
margin: 0;
padding: 0;
font-family: Helmet, Freesans, Helvetica, Arial, sans-serif;
;
}
#logo {
margin-top: 8px;
float: left;
margin-right: 8px;
}
.border-part {
float: left;
height: 100%;
border-left: 1px #CCCCCC solid;
}
#logo-image {
width: 20px;
margin: 12px;
float: left;
}
.signin-text {
margin: 14px;
font-size: 90%;
font-weight: bold;
float: left;
}
#dash-image {
padding-left: 50px;
float: left;
height: 40px;
}
#bell {
margin: 8px;
height: 28px;
float: left;
}
.stuff-section {
font-weight: bold;
font-size: 90%;
padding: 13px 15px 0 15px;
height: 27px;
}
.seacher-border {
float: left;
height: 100%;
border-left: 1px #CCCCCC solid;
margin-left: 20px;
}
#search-box {
margin: 10px;
font-weight: bold;
background-color: #E4E4E4;
font-size: 14px;
border: none;
height: 24px;
float: left;
}
#search-pic {
position: relative;
right: 10px;
top: 10px;
height: 25px;
}
#second-bar {
background-color: #BB1919;
width: 100%;
height: 80px;
}
#newsbar {
width: 1080px;
margin: 0 auto;
background-color: blue;
}
h1 {
padding: 0;
margin: 0;
float;
}
A flexbox option for alignment
#second-bar {
display: flex;
background-color: #BB1919;
width: 100%;
height: 80px;
}
#newsbar {
display: flex;
justify-content: flex-start; /* horizontal alignment - change to flex-end or center to see difference */
align-items: center; /* vertical alignment */
width: 100%;
margin:0 auto;
}
h1 {
display: flex;
padding:0;
margin:0;
}
<div id="second-bar">
<div id="newsbar">
<h1>NEWS</h1>
</div>
</div>
fiddle
https://jsfiddle.net/Hastig/zn4qkok2/
A possible non-flexbox solution
#second-bar {
background-color: #BB1919;
width: 100%;
height: 80px;
}
#newsbar {
text-align: left; /* change to center or right to see difference */
vertical-align: middle;
width: 100%;
line-height: 80px; /* match to height of parent for centered vertical alignment */
margin:0 auto;
}
h1 {
display: inline-block;
padding:0;
margin:0;
}
<div id="second-bar">
<div id="newsbar">
<h1>NEWS</h1>
</div>
</div>
fiddle
https://jsfiddle.net/Hastig/zn4qkok2/1/
Just add clear: both to h1:
#topbar {
width: 1080px;
margin: 0 auto;
height: 40px;
}
body {
margin: 0;
padding: 0;
font-family: Helmet, Freesans, Helvetica, Arial, sans-serif;
;
}
#logo {
margin-top: 8px;
float: left;
margin-right: 8px;
}
.border-part {
float: left;
height: 100%;
border-left: 1px #CCCCCC solid;
}
#logo-image {
width: 20px;
margin: 12px;
float: left;
}
.signin-text {
margin: 14px;
font-size: 90%;
font-weight: bold;
float: left;
}
#dash-image {
padding-left: 50px;
float: left;
height: 40px;
}
#bell {
margin: 8px;
height: 28px;
float: left;
}
.stuff-section {
font-weight: bold;
font-size: 90%;
padding: 13px 15px 0 15px;
height: 27px;
}
.seacher-border {
float: left;
height: 100%;
border-left: 1px #CCCCCC solid;
margin-left: 20px;
}
#search-box {
margin: 10px;
font-weight: bold;
background-color: #E4E4E4;
font-size: 14px;
border: none;
height: 24px;
float: left;
}
#search-pic {
position: relative;
right: 10px;
top: 10px;
height: 25px;
}
#second-bar {
background-color: #BB1919;
width: 100%;
height: 80px;
}
#newsbar {
width: 1080px;
margin: 0 auto;
background-color: blue;
}
h1 {
padding: 0;
margin: 0;
clear: both;
}
<div id="topbar">
<div id="logo"> <img src="Pictures/bbc.png"> </div>
<div id="signin" class="border-part"> </div>
<div> <img id="logo-image" src="Pictures/signin.png">
<p class="signin-text">Sign in</p>
</div>
<div id="dash"> <img id="dash-image" src="Pictures/bash2.png"> </div>
<div> <img id="bell" src="Pictures/bell3.png"> </div>
<div class="border-part stuff-section"> News </div>
<div class="border-part stuff-section"> Sport </div>
<div class="border-part stuff-section"> Weather </div>
<div class="border-part stuff-section"> iPlayer </div>
<div class="border-part stuff-section"> TV </div>
<div class="border-part stuff-section"> Radio </div>
<div class="border-part stuff-section"> More </div>
<div class="seacher-border">
<input id="search-box" type="text" placeholder="Search">
<img id="search-pic" src="Pictures/search.png"> </div>
</div>
<div id="second-bar">
<div id="newsbar">
<h1>NEWS</h1>
</div>
</div>

Text in header tag auto move to the right side of box without any css stuff

It is a common <h3> but the text appear on the right side of box, not extreme right but almost, something like that
h3:
.....................................................................................................................................................................
text appear here
.....................................................................................................................................................................
html file:
<div class="fifth">
<p>F-Village</p>
<div class="f-t">
<div class="f-t-col" id="f-t-c-photos">
<h2>Photos</h2>
<div class="big-photo">
<img src="./images/photo.jpg">
</div>
<div class="small-photo">
<img src="./images/photo.jpg">
<img src="./images/photo.jpg">
<img src="./images/photo.jpg">
</div>
</div>
<div class="f-t-col" id="f-t-c-material">
<h2>Material</h2>
<span>
...some text...
</span>
<p>
<img src="./images/history.jpg">
...some text...
</p>
</div>
<div class="f-t-col">
<h2>Words</h2>
<p class="words"><em>"...some text..."</em>
</p>
</div>
</div>
<div class="f-m">
<div class="f-m-l">
<h3>Video</h3> <!--The problem appear here-->
</div>
</div>
</div>
css file:
.fifth{
/* margin-top: 40px; */
width: 100%;
height: 700px;
color: white;
background-image: url('../images/ww-bg.jpg');
margin: auto;
}
.fifth .f-t-col{
color: white;
height: 265px;
width: 27%;
display: inline-block;
margin-left: 57px;
float: left;
}
#f-t-c-photos div{
float: left;
}
#f-t-c-photos .big-photo{
width: 190px;
}
#f-t-c-photos div:last-child{
width: 80px;
}
.f-t{
width: 1102px;
margin-left: 125px;
height: 240px;
border-bottom: 2px solid rgba(100, 100, 100, 0.9);
}
.small-photo img{
margin-bottom: 2px;
height: 55px;
width: 60px;
}
.small-photo img:first-child{
margin-top: 15px;
}
.big-photo img{
width: 165px;
height: 171px;
margin-top: 15px;
border: 2px #00b3ff solid;
}
.f-t-middle img{
width: 165px;
height: 170px;
margin-top: 15px;
border: 2px #00b3ff solid;
}
.words{
margin-top: 65px;
font-size: 17px;
}
.fifth h2{
color: #2e2e2e;
font-size: 17px;
color: whitesmoke;
padding: 0 0 10px 7px;
background: url('../images/ww-title.png') top right no-repeat;
margin-top: 5px;
height: 8px;
border-left: 3px solid red;
}
#f-t-c-material img{
float: left;
width: 215px;
}
#f-t-c-material span{
font-weight: 800;
font-size: 16px;
color: #00b3ff;
}
.f-m:before{
clear: both;
}
.f-m h3{
color: white;
}
You can align your text like this,
h1 {
text-align: center;
}
h2 {
text-align: left;
}
h3 {
text-align: right;
}
If the text is in a div that is floating right or margin right, you could change it to
float: left;

Changing an image on hover while scaling it

I need to get the image to change onmouseenter/hover to a different image. I looked around and found a lot of rollover solutions but that won't work for me because I need to scale the image on hover as well.
Also the last image in #recent appears to be broken, hovering over the #galleries section has a link to it and i can't figure out if that is because of col-md-offset-1 or something else.
<body>
<div id="wrap">
<div id="topbar">
</div>
<div id="menu">
</div>
<div id="logo">
</div>
<div id="jumbotron">
</div>
<div id="recent">
<h1>Recent Work</h1>
<div class="col-md-2 col-md-offset-1">
<a href="http://shniper1337.github.io/firstbootstrap/">
<img src="images/firstbootstrap.png" class="img-rounded"></a>
</div>
<div class="col-md-2">
<a href="http://shniper1337.github.io/pong/">
<img src="images/pong.png" class="img-rounded"></a>
</div>
<div class="col-md-2">
<a href="http://shniper1337.deviantart.com/art/Photomontage-490696483">
<img src="images/design.png" class="img-rounded"></a>
</div>
<div class="col-md-2">
<a href="http://shniper1337.deviantart.com/art/Website-design-WIP-571887134">
<img src="images/survivingearth.png" class="img-rounded">
</div>
<div class="col-md-2">
<a href="http://shniper1337.deviantart.com/art/Old-Law-Firm-545208961">
<img src="images/lawfirm.png" class="img-rounded">
</div>
</div>
<div id="galleries">
<div class="row">
<div class="col-md-4">
<h2>Website Design</h2>
<p>Extensive experience with image editing software, html and css code, and a unique perspective of an IT major formerly in graphic design.</p>
</div>
<div class="col-md-4">
<h2>Software Engineering</h2>
<p>Information Technology second-semester Sophomore at State University of New York at Cobleskill. Passion for solving problems with logic and code.</p>
</div>
<div class="col-md-4">
<h2>Other Work</h2>
<p>Former graphic artist with a background in a hobbyist form of art known as forum signatures.</p>
</div>
</div>
</div>
<div id="sn">
</div>
<div id="footer">
</div>
</div>
</body>
body {
background-color: #EAE8EB;
}
wrap {
margin: auto;
}
#topbar {
width: 100%;
height: 50px;
background-color: #000;
margin-top: -10px;
}
#jumbotron {
width: 100%;
height: 750px;
background-repeat: no-repeat;
background-size: cover;
background-image: url('http://www.arcanemarketing.com/wp-content/uploads/2013/05/placeholder.png');
}
#recent {
margin: auto;
background-color: #3C5F7C;
width: 100%;
height: 250px;
margin-top: -20px;
}
#recent h1 {
text-align: center;
font-family: 'Alegreya Sans SC', sans-serif;
font-size: 38px;
font-weight: 700;
padding-top: 10px;
color: #EEF0F2;
}
#recent img {
height: 155px;
box-shadow: 5px 5px 5px #111111;
margin-top: 10px;
position: relative;
}
#galleries {
background-color: #3c5f7c;
height: 200px;
}
.col-md-4 {
max-width: 27%;
margin-left: 3%;
}
.row {
margin-left: 6%;
}
#recent div:nth-of-type(1) img:hover {
background-image: url("images/firstbootstrapfull.png");
z-index: 1;
position: relative;
}
#recent div:nth-of-type(2) img:hover {
}
#recent div:nth-of-type(3) img:hover {
}
#recent div:nth-of-type(4) img:hover {
}
#recent div:nth-of-type(5) img:hover {
}
#galleries h2 {
font-size: 32px;
font-family: 'Alegreya Sans SC', sans-serif;
font-weight: 500;
color: #EEF0F2;
}
#galleries div:nth-of-type(1) h2 {
text-align: right;
}
#galleries div:nth-of-type(2) h2 {
text-align: center;
}
#galleries div:nth-of-type(3) h2 {
text-align: left;
}
#galleries p {
font-size: 18px;
font-family: 'Catamaran', sans-serif;
font-weight: 300;
color: #eef0f2;
}
#galleries div:nth-of-type(1) p {
text-align: right;
margin: auto;
}
#galleries div:nth-of-type(2) p {
text-align: center;
margin: auto;
}
#galleries div:nth-of-type(3) p {
text-align: left;
margin: auto;
}
#footer {
width: 100%;
height: 20px;
background-color: #000;
}
Here is a jsfiddle that appears to be broken
Solving this with css is preferred but not necessary.
You could add in something like this to your CSS
#randomDiv {
background-image: url('image.png');
height: 70px;
width: 120px;
}
#randomDiv:hover {
background-image: url('differenthoverimage.png');
width: 50px; // or whatever width you want
height: 50px; // or whatever height you want
}
And that should change the image and height/width.
(make sure to add a different id for each image you want to do this and set it in the HTML)

Resources