I've been struggling to move this image up, despite trying several methods. I really want it to be aligned horizontally with the PV
picture.
I need the HP
image to be moved directly upwards so that it aligns horizontally with the PV
image.
This is the content of my index.html
file:
<!DOCTYPE html>
<html>
<head>
<title>Website</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="index.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.16/browser.js"></script>
</head>
<header>
<nav>
<ul>
<button type="button" class="btn btn-primary">Portfolio</button>
<button type="button" class="btn btn-primary">About</button>
<button type="button" class="btn btn-primary">Contact</button>
</ul>
</nav>
<img src="./pictures/skyline.jpg" class="mainPic"></img></br>
</header>
<body class="content">
<nav>
<h2><u>Portfolio</u></h2>
<li>
<!-- PV -->
<div class="container">
<img class="pvPic" src="./pictures/portfolioPic1.png"></img>
<div class="middlePv">
<div class="pvText">Menu for catering company.</div>
</div>
</div>
<!-- WFAFA -->
<div class="container">
<img src="./pictures/WFAFA.png" class="WFAFAPic img-rounded"></img>
<div class="middleWFAFA">
<div class="WFAFAText">World's first automated financial advisor.</div>
</div>
</div>
<!-- Hunts Points Shipyard LLC -->
<div class="container2">
<img src="./pictures/HP.png" class="HPPic img-rounded"></img>
<div class="middleHP">
<div class="HPText">Hunts Point Seaport and Shipyard LLC company website.</div>
</div>
</div>
</li>
</nav>
</body>
</html>
This is what I have in my index.css
file:
html {
text-align: center;
}
/* PV */
.container {
position: relative;
}
.pvPic {
display: block;
max-width: 30%;
height: auto;
opacity: 1;
transition: .5s ease;
backface-visibility: hidden;
}
.middlePv {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 16%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%)
}
.container:hover .pvPic {
opacity: 0.3;
}
.container:hover .middlePv {
opacity: 1;
}
.pvText {
background-color: #4CAF50;
color: white;
font-size: 16px;
padding: 16px 32px;
}
/* WFAFA */
.container {
position: relative;
}
.WFAFAPic {
display: block;
max-width: 30%;
height: auto;
opacity: 1;
transition: .5s ease;
backface-visibility: hidden;
}
.middleWFAFA {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 16%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%)
}
.container:hover .WFAFAPic {
opacity: 0.3;
}
.container:hover .middleWFAFA {
opacity: 1;
}
.WFAFAText {
background-color: #4CAF50;
color: white;
font-size: 16px;
padding: 16px 32px;
}
/* HP Shipyard */
.container {
position: relative;
}
.HPPic {
display: block;
max-width: 30%;
height: auto;
opacity: 1;
transition: .5s ease;
backface-visibility: hidden;
float: right;
display: inline-block;
vertical-align: top;
}
.middleHP {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 49%;
left: 87%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%)
}
.container:hover .HPPic {
opacity: 0.3;
}
.container:hover .middleHP {
opacity: 1;
}
.HPText {
background-color: #4CAF50;
color: white;
font-size: 16px;
padding: 16px 32px;
}