Expanding a div with content without moving elements below it - html

I have an element on the page which, when it is hovered over, expands and reveals some previously hidden text within it. The problem is that when the element expands, it moves other content below it. I tried to use position:absolute, but it has not achieved the desired effect.
.col {
padding: 20px;
}
.col:hover {
background-color: lightgray;
}
.revealOnHover {
display: none;
/*position: absolute;*/
}
#block1:hover .revealOnHover,
#block2:hover .revealOnHover {
display: block;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<div class="container">
<div class="row">
<div class="col" id="block1">
<img src="https://picsum.photos/100/100?random=1">
<p><b>Lorem ipsum dolor sit amet</b></p>
<i class="fas fa-caret-down" style="color: red;"></i>
<p class="revealOnHover">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="col" id="block2">
<img src="https://picsum.photos/100/100?random=1">
<p><b>Excepteur sint occaecat cupidatat non proident</b></p>
<i class="fas fa-caret-down" style="color: red;"></i>
<p class="revealOnHover">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
<p> </p>
<div style="text-align: center;">
<button type="button" class="btn btn-secondary" style="font-weight: bold; margin: 0 auto; margin-right: 2rem; color: #FFF">Click here</button>
<button type="button" class="btn btn-secondary" style="font-weight: bold; margin: 0 auto; margin-right: 2rem; color: #FFF">Click here</button>
</div>
</div>
My Code: https://codepen.io/eren5897/pen/GRqgOyd

You're not far off actually. position:absolute is the way to go, but you need a few additional styles to make it work, mainly in order to correctly position it and make it share the background color of its parent.
.col {
padding: 20px;
}
.col:hover {
background-color: lightgray;
}
.revealOnHover {
display: none;
position: absolute;
left: 0;
right: 0;
padding: 10px;
background: inherit;
}
#block1:hover .revealOnHover,
#block2:hover .revealOnHover {
display: block;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<div class="container">
<div class="row">
<div class="col" id="block1">
<img src="https://picsum.photos/100/100?random=1">
<p><b>Lorem ipsum dolor sit amet</b></p>
<i class="fas fa-caret-down" style="color: red;"></i>
<p class="revealOnHover">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="col" id="block2">
<img src="https://picsum.photos/100/100?random=1">
<p><b>Excepteur sint occaecat cupidatat non proident</b></p>
<i class="fas fa-caret-down" style="color: red;"></i>
<p class="revealOnHover">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
<p> </p>
<div style="text-align: center;">
<button type="button" class="btn btn-secondary" style="font-weight: bold; margin: 0 auto; margin-right: 2rem; color: #FFF">Click here</button>
<button type="button" class="btn btn-secondary" style="font-weight: bold; margin: 0 auto; margin-right: 2rem; color: #FFF">Click here</button>
</div>
</div>

Add min-height to your row class
Your class becomes
.row {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
min-height: 317PX;}

How about adding
.row {
min-height: 20rem
}
This makes sure that they don't move when the divs are being expanded.

Related

Font Awesome Icon inline with headline and text

I'm trying to create a nice layout for product descriptions using font awesome icons, headline and paragraph text with HTML & CSS .
This will be used in WooCommerce single product pages, so I'm trying to avoid inline styling so that I can put the HTML code in the WordPress wysiwyg editor and CSS in the stylesheet.
I've created a visual example of the layout I'm trying to create, but I'm not sure what is practice to achieve it.
Below is the code so far, could anybody please help to stack the display so that icon, headline, text appear together like image but on top of each other inside of flexed / side to side
Code Pen Link
HTML
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" />
<div class="propertydescription_wrapper">
<div class="icon">
<i class="fas fa-search-location fa-3x"></i>
</div>
<div class="text">
<h3>Headline</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
<p/>
</div>
<div class="icon">
<i class="fas fa-search-location fa-3x"></i>
</div>
<div class="text">
<h3>Headline</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
<p/>
</div>
</div>
CSS
.propertydescription_wrapper {
display: flex;
align-items: flex-start;
}
.propertydescription_wrapper * {
margin: 0px;
}
.propertydescription_wrapper .icon {
color: #A7784A
}
.propertydescription_wrapper .text {
padding-top: 5px;
padding-left: 20px;
}
.propertydescription_wrapper .text h3 {
padding-bottom: 10px;
}
Flexbox can do that.
.wrapper {
display: flex;
align-items: flex-start;
}
* {
margin: 0;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" />
<div class="wrapper">
<div class="icon">
<i class="fa fa-quote-left fa-border" style=""></i>
</div>
<div class="text">
<h3>Headline</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.
<p/>
</div>
</div>

How do i make a text block within on top of an image responsive?

I'm coding my personal website using inline CSS (the CMS doesn't support CSS that isn't inline) and I'm struggling with making my design be responsive on mobile.
It looks great on the iPad and on desktop, but it looks terrible on mobile making as it exceeds the width of the website itself.
Here is how it looks like on desktop
Here is the code that I am currently using:
<div style="position:relative;font-family:Lato;" >
<img src="https://images.unsplash.com/photo-1589503099580-00dc088a0081?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80" alt="Nature" style="width: 100%">
<div class="text-block" style="position:absolute;top:150px;right:90px;left:650px;background-color:white;color:black;padding-top:10px;padding-bottom:20px;padding-left:20px;padding-right:20px;width:100%;" >
<h2><div style="font-size: 45px; line-height: 76px;"><font color="#f56b00"><b>Lorem Ipsum</b></font></div></h2>
<div style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
</div>
</div>
I would like it to be mobile responsive by having the text box on the bottom or within the image. I've tried adding width:100%; after the padding and within the div style of the header but it still doesn't work.
Thank you very much.
Here is suggestion how to achieve that.
<div style="position: relative; font-family: Lato;">
<img
src="https://images.unsplash.com/photo-1589503099580-00dc088a0081?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80"
alt="Nature"
style="width: 100%; height: 60%"
/>
<div
class="text-block"
style="
position: absolute;
background-color: white;
color: black;
padding: 10px 20px 20px 20px;
width: 45%;
top: 40%;
left:60%;
transform: translate(-50%, -50%);
">
<h2>
<div style="font-size: 45px; line-height: 76px;">
<font color="#f56b00"><b>Lorem Ipsum</b></font>
</div>
</h2>
<div style="font-size: 16px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.
</div>
</div>
</div>

why section-testimonial is not placing correctly [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am trying to build the testimonial section but it's not placing orderly, it's placing within the services section. here's the codepen link:
https://codepen.io/Razu381/pen/XQJVzg
here is the code:
<div class="section-testimonial">
<div class="row" >
<div class="col-md-2">
<h2> What people say about me</h2>
</div>
<div class="col-md-10">
<p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
</div>
</div>
</div>
just remove this css:
.section-services{
}
.services-overlay{
position: absolute;
top: 80%;
}
check out my answer:
#import url('https://fonts.googleapis.com/css?family=Josefin+Slab:300,400|Lato:300i,400|Pacifico|Tangerine:400,700&display=swap');
body{
font-family: lato;
font-size: 20px;
}
.header-text{
font-size: 30px;
font-weight: bold;
word-spacing: 3px;
letter-spacing: 3px;
font-family: Abril Fatface;
color:#2ecc71;
}
.degrees{
font-size: 20px;
}
.top-nav{
font-size: 20px;
font-family: lato;
}
.navbar-light .navbar-nav .nav-link{
color: black;
margin: 3px;
}
.s-icon i{
margin:3px;
}
/*----about me section---*/
.section-about{
background: #f8f8f8;
}
.section-about h2{
font-family: Abril Fatface;
font-size: 40px!important;
letter-spacing: 3px;
word-spacing: 4px;
}
.section-about h2{
margin-top: 100px;
}
h2:after {
display: block;
width: 100px;
height: 3px;
background-color: #2ecc71;
content: "";
margin-top: 10px;
margin-bottom: 10px;
}
.section-about p{
margin-top: 30px;
}
/*----services section---*/
.section-services .card{
background-color: #2ecc713d;
}
.section-services .card-header{
background-color:#2ecc71;
text-align: center;
margin:5px 0;
}
.section-services h2{
font-family: Abril Fatface;
font-size: 40px!important;
letter-spacing: 3px;
word-spacing: 4px;
position: absolute;
top: 10%;
right: 50%;
text-transform: uppercase;
}
.section-services h2:after{
width: 220px;
}
.section-services p{
text-align: center;
}
.section-services .card-body img{
max-width: 100%;
text-align: center;
display: block;
height: 150px;
width: 50%;
margin: 0 auto;
}
/*------section-testimonial---*/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>homw</title>
<script src="https://kit.fontawesome.com/7ea1edf4c8.js"></script>
<link href="https://fonts.googleapis.com/css?family=Josefin+Slab|Lato|Pacifico|Tangerine&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="resources/css/style.css">
<link href="https://fonts.googleapis.com/css?family=Abril+Fatface|Roboto&display=swap" rel="stylesheet">
<script src="https://kit.fontawesome.com/367919f9b0.js"></script>
<style>
.carousel-item{
height: 100vh;
}
.carousel-item img{
height: 100vh;
object-fit:cover;
overflow: hidden;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" style="font-family:Pacifico;font-size: 30px;color: #2ecc71;" href="#">DR. S. Faruqi</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<div class="navbar-nav mx-auto top-nav" >
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="#">About Me</a>
<a class="nav-item nav-link" href="#">Services</a>
<a class="nav-item nav-link " href="#">Testimonials</a>
<a class="nav-item nav-link " href="#">Chembers</a>
</div>
<span class="s-icon">
<i class="fab fa-facebook-square fa-2x"></i>
<i class="fab fa-twitter-square fa-2x"></i>
<i class="fab fa-youtube-square fa-2x"></i>
</span>
</div>
</nav>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" style="height: 100vh;position: relative;">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://source.unsplash.com/random" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/random/2" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/random/3" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/random/4" class="d-block w-100" alt="...">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="section-about">
<div class="container">
<div class="row">
<div class="col-md-5">
<h2>About Me</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. </p>
</div>
<div class="col-md-7">
<img src="https://source.unsplash.com/random/22" alt="" class="img-fluid">
</div>
</div>
</div>
</div>
<div class="section-services "style="position:relative ;" >
<img src="https://source.unsplash.com/random/5.png" alt="" style="width: 100%;height: 400px;">
<h2>Services </h2>
<div class="container">
<div class="services-inner">
<div class="row services-overlay ">
<div class="col-md-4 ">
<div class="card">
<div class="card-body">
<img src="https://source.unsplash.com/random/6" alt="" class=" card-img-top " >
<h4 class="card-header">Primary Treatment</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="card">
<div class="card-body">
<img src="https://source.unsplash.com/random/7" alt="" class="card-img-top " >
<h4 class="card-header">Primary Injury</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="card">
<div class="card-body">
<img src="https://source.unsplash.com/random/8" alt="" class=" card-img-top " >
<h4 class="card-header">Vaccination</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="card">
<div class="card-body">
<img src="https://source.unsplash.com/random/9" alt="" class=" card-img-top " >
<h4 class="card-header">Health Advice</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="card">
<div class="card-body">
<img src="https://source.unsplash.com/random/10" alt="" class=" card-img-top " >
<h4 class="card-header">Childern care</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="card">
<div class="card-body">
<img src="https://source.unsplash.com/random/11" alt="" class=" card-img-top">
<h4 class="card-header">Health education</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
</div>
</div>
</div>
<!--end of row-->
</div>
</div>
</div>
<div class="section-testimonial">
<div class="row" >
<div class="col-md-2">
<h2> What people say about me</h2>
</div>
<div class="col-md-10">
<p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
</body>
</html>

Flexbox align content

I have a pretty basic structure like so
<section id="portfolio">
<div class="col-lg-5 col-sm-5 vertical-center" id="portfolio-left">
<div id="portfolio-title">
<h2>Work</h2>
</div>
</div>
<div class="col-lg-7 col-sm-7" id="portfolio-right">
<div class="swiper-slide goldBG" id="cSlide2">
<div class="col-md-6 col-md-offset-3 vertical-center" id="inner">
<h3>Some title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
</section>
It has a left section and a right section. Now I wanted the content within these section to be vertically aligned in the middle, so I used flex for the first time
.vertical-center {
align-items: center;
display: flex;
}
This works well as you can see from the JSFiddle The problem I am having is with the right section. You can see that it is vertically aligned correctly, however, the items (h3 and p) inside seem to be aligned inline.
Is there any way I can get these items to display as a block? I have tried a few things that do this, but then it messes up my vertically alignment.
Any advice appreciated.
Thanks
Make you inner div a column flexbox:
#inner {
flex-direction: column;
align-items: flex-start;
justify-content: center;
}
See demo below:
#portfolio {
height: 100vh;
}
section#portfolio {
padding-bottom: 0;
padding-top: 0;
}
#portfolio-right {
height: 100%;
padding: 0;
}
#cSlide2 {
height: 350px !important;
}
#cSlide2 #inner {
height: 100%;
}
.vertical-center {
align-items: center;
display: flex;
}
#portfolio-right .goldBG {
background: #fabc2f;
}
#portfolio-left {
height: 100%;
background: #35a887;
}
#inner {
flex-direction: column;
align-items: flex-start;
justify-content: center;
}
<section id="portfolio">
<div class="col-lg-5 col-sm-5 vertical-center" id="portfolio-left">
<div id="portfolio-title">
<h2>Work</h2>
</div>
</div>
<div class="col-lg-7 col-sm-7" id="portfolio-right">
<div class="swiper-slide goldBG" id="cSlide2">
<div class="col-md-6 col-md-offset-3 vertical-center" id="inner">
<h3>Some title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
</section>
Put your <h3> & <p> inside a parent <div> (in my case its .content-holder). Because its the property to flex to inline the items.
Like:
<div class="content-holder">
<h3>Some title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
You can use flex-direction: column too but this will make each of your content wrap to next line, so its better to wrap these into a parent div.
Have a look at the snippet below:
#portfolio {
height:100vh;
}
section#portfolio {
padding-bottom: 0;
padding-top: 0;
}
#portfolio-right {
height: 100%;
padding: 0;
}
#cSlide2 {
height:350px !important;
}
#cSlide2 #inner {
height:100%;
}
.vertical-center {
align-items: center;
display: flex;
}
#portfolio-right .goldBG {
background: #fabc2f;
}
#portfolio-left {
height:100%;
background: #35a887;
}
<section id="portfolio">
<div class="col-lg-5 col-sm-5 vertical-center" id="portfolio-left">
<div id="portfolio-title">
<h2>Work</h2>
</div>
</div>
<div class="col-lg-7 col-sm-7" id="portfolio-right">
<div class="swiper-slide goldBG" id="cSlide2">
<div class="col-md-6 col-md-offset-3 vertical-center" id="inner">
<div class="content-holder">
<h3>Some title</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
</div>
</section>
Hope this helps!

I need help placing 3 div's next to each other with a text hover

I am trying to place 3 images next together in a div. To add to this complication is that I need to hid the image and reveal text when the mouse hovers over the image.
Here is my HTML code:
<div class="TopRow">
<div class="TP">
<div class="TitleM">
TP
</div>
<div class="showcase">
<img src="image" alt="TPM"/>
<p >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. >> Shop </p>
</div>
</div>
<div class="SF">
<div class="TitleM">
Stearns & Foster
</div>
<div class="showcase">
<img src="image" alt="TPM"/>
<p >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. >> Shop </p>
</div>
</div>
<div class="VS">
<div class="TM">
VS
</div>
<div class="showcase">
<img src="image" alt="TPM"/>
<p >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. >> Shop </p>
</div>
</div>
Here is my CSS
<style type="text/css">
div.showcase {height: 241px; width: 300px; border: solid 1px #939598;}
div.showcase p {display: none;}
div.showcase:hover img {display: none;}
div.showcase:hover p {display: block;}
}
.TopRow {
height: auto;
width: 95%;
margin-right: auto;
margin-bottom: 10px;
margin-left: auto;
}
.TP {
Float:left;
height: auto;
width: 33%;
.V3 {
margin:0;
height: auto;
width: 33%;
.SF {
Float:right;
height: auto;
width: 33%;
}
.TM {
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 125%;
background-color: #dce1e9;
text-align: left;
margin-bottom: 3px;
padding-left:0px;
padding-top:5px;
padding-bottom:5px;
height: auto;
width: 100%;
border: solid 1px #939598;
text-indent: 5px;
}
I know my issue is in the set size in showcase div, however I can not get things to line up correctly. Any help would be appreciated.
I've attempted to solve your problem in this fiddle: Click me for Fiddle
I've also tried to clean your code up a bit as there were quite a few errors.
HTML
<div class="TopRow">
<div class="TP">
<div class="TitleM">
TP
</div>
<div class="showcase">
<img src="http://osric.com/8ball/images/eight-ball.png" alt="TPM"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. >> Shop </p>
</div>
</div>
<div class="SF">
<div class="TitleM">
Stearns & Foster
</div>
<div class="showcase">
<img src="http://osric.com/8ball/images/eight-ball.png" alt="TPM"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. >> Shop </p>
</div>
</div>
<div class="VS">
<div class="TM">
VS
</div>
<div class="showcase">
<img src="http://osric.com/8ball/images/eight-ball.png" alt="TPM"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. >> Shop </p>
</div>
</div>
</div>
CSS
div.showcase {
border: solid 1px #939598;
}
div.showcase p {
visibility:hidden;
}
div.showcase:hover img {
visibility:hidden;
}
div.showcase:hover p {
visibility: visible;
}
body {
margin:0;
}
.TopRow {
width: 99%;
margin-bottom: 10px;
}
.TP {
width:33%;
display:inline-block;
}
.VS {
width:33%;
display:inline-block;
}
.SF {
width: 33%;
display:inline-block;
}