Animate a div from bottom to top with css - html

I need to animate a div going from bottom to top.
This is the situation:
I have a thumbnail that includes the title and description of a movie inside of it. I want to hide the description and only show it when the user hovers the mouse on it.
I tried resizing the height of the container but you can't animate it when the value is set to "auto", and i can't provide an specific size for it because the title may vary for each movie.
And as a lot of you may know, you can't animate from bottom to top using the "bottom" and "top" properties.
This is the html:
<div class="thumbnail-component">
<img class="thumbnail-component__background" src="background.jpg" alt="">
<div class="thumbnail-component__gradient"></div>
<div class="text">
<div class="text__content">
<p class="text__title">The movie title</p>
<div class="text__separator"></div>
<p class="text__description">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
<p class="text__author">Published by Author</p>
</div>
</div>
And here is an image of what i'm trying to accomplish:
I'm honestly completely lost, i think i tried everything i know.
Sorry for my not too great english.

Show Card description on Card hover
Completely flexible and responsive
No hard-coded or arbitrary heights, no JS involved.
Basically,
translateY the title to -100%, on hover animate to 0
Wrap both title and content into a DIV (i.e: .anim)
translateY .anim to +100%, and on hover animate it to 0
Open the example in full page to see what happens and how it works:
/*QuickReset*/*{margin:0;box-sizing:border-box;}
.thumb {
width: 140px;
background: #eee;
}
.anim {
transition: 0.5s;
transform: translateY(100%);
}
.title {
color: red;
transition: 0.5s;
transform: translateY(-100%);
}
.author {
color: blue;
}
/* ANIMATE */
.thumb:hover .anim,
.thumb:hover .title {
transform: translateY(0);
}
<div class="thumb">
<div class="anim">
<div class="title">The movie even longer title</div>
<div class="description">
Text lenghts of Title and Author or even Description do not matter. They will all perfectly accommodate into .thumb on hover
</div>
</div>
<div class="author">Published by super long some Author</div>
</div>
Flexbox Grid!
The real-case proof of concept example:
/*QuickReset*/
* {
margin: 0;
box-sizing: border-box;
}
html {
height: 100%
}
body {
min-height: 100%;
font: 14px/1.4 sans-serif;
}
.grid-3 {
display: flex;
flex-flow: row wrap;
}
.thumb {
display: flex;
flex-flow: column nowrap;
position: relative;
overflow: hidden;
width: 33.333%;
color: #fff;
}
.thumb-gradient,
.thumb-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.thumb-gradient {
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.56) 100%);
}
.thumb-anim {
margin-top: auto; /* pushes all content to bottom */
position: relative;
transition: 0.5s;
transform: translateY(100%);
}
.thumb-title {
text-transform: uppercase;
padding: 20px;
transition: 0.5s;
transform: translateY(-100%);
}
.thumb-description {
padding: 10px 20px;
transition: 0.5s;
opacity: 0;
flex: 1;
}
.thumb-author {
padding: 20px;
position: relative;
}
/* ANIMATE */
.thumb:hover .thumb-anim {
transform: translateY(0);
}
.thumb:hover .thumb-title {
transform: translateY(0%);
}
.thumb:hover .thumb-description {
opacity: 1;
}
<div class="grid-3">
<div class="thumb">
<img class="thumb-img" src="http://placekitten.com/300/300" alt="Catz!">
<div class="thumb-gradient"></div>
<div class="thumb-anim">
<h3 class="thumb-title">The movie title</h3>
<p class="thumb-description">
Text lenghts of Title and Author or even Description do not matter. They will all perfectly accommodate into .thumb on hover
</p>
</div>
<div class="thumb-author">Published by super long some Author</div>
</div>
<div class="thumb">
<img class="thumb-img" src="http://placekitten.com/400/300" alt="Catz!">
<div class="thumb-gradient"></div>
<div class="thumb-anim">
<h3 class="thumb-title">The movie title</h3>
<p class="thumb-description">
The row heights are dictated by the tallest in the horizontal group
</p>
</div>
<div class="thumb-author">Published</div>
</div>
<div class="thumb">
<img class="thumb-img" src="http://placekitten.com/230/300" alt="Catz!">
<div class="thumb-gradient"></div>
<div class="thumb-anim">
<h3 class="thumb-title">The movie title a super long title here</h3>
<p class="thumb-description">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellendus facilis beatae, numquam aliquam eveniet. Iure porro provident itaque hic quae tempora. Quaerat doloribus dolore facilis similique, soluta asperiores quas sapiente.
</p>
</div>
<div class="thumb-author">Published by super long some Author</div>
</div>
<div class="thumb">
<img class="thumb-img" src="http://placekitten.com/270/300" alt="Catz!">
<div class="thumb-gradient"></div>
<div class="thumb-anim">
<h3 class="thumb-title">The movie title</h3>
<p class="thumb-description">
Text lenghts of Title and Author or even Description do not matter. They will all perfectly accommodate into .thumb on hover
</p>
</div>
<div class="thumb-author">Published by super long some Author</div>
</div>
<div class="thumb">
<img class="thumb-img" src="http://placekitten.com/250/370" alt="Catz!">
<div class="thumb-gradient"></div>
<div class="thumb-anim">
<h3 class="thumb-title">The movie title</h3>
<p class="thumb-description">
Text lenghts of Title and Author or even Description do not matter. They will all perfectly accommodate into .thumb on hover
</p>
</div>
<div class="thumb-author">Yep. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate sequi aspernatur cumque saepe incidunt enim, nihil dolores ipsam numquam architecto velit labore quod laboriosam aliquam distinctio tempora unde ad totam.</div>
</div>
<div class="thumb">
<img class="thumb-img" src="http://placekitten.com/290/340" alt="Catz!">
<div class="thumb-gradient"></div>
<div class="thumb-anim">
<h3 class="thumb-title">The movie title</h3>
<p class="thumb-description">
Text lenghts of Title and Author or even Description do not matter. They will all perfectly accommodate into .thumb on hover
</p>
</div>
<div class="thumb-author">Published by super long some Author</div>
</div>
</div>

Pretty easy with CSS transform...
.thumbnail-component {
width: 240px;
border: 1px solid red;
overflow: hidden;
cursor: pointer;
}
.thumbnail-component .text {
display: inline-block;
position: relative;
text-align: center;
transform: translateY(70%);
transition: all 1s ease;
}
.thumbnail-component:hover .text {
transform: translateY(0%);
}
<div class="thumbnail-component">
<img class="thumbnail-component__background" src="background.jpg" alt="">
<div class="thumbnail-component__gradient"></div>
<div class="text">
<div class="text__content">
<p class="text__title">The movie author</p>
<div class="text__separator"></div>
<p class="text__description">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
<p class="text__author">Published by Author</p>
</div>
</div>
</div>

You can transition on the flex property, which could be useful here. To reveal the description during the hover, I set its opacity to 0 and position it absolutely safely inside its relative parent container. Finally, I removed the text__separator div because it wasn't useful to be as a flex child.
.text__content {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.text__content__top {
position: relative;
margin-top: auto;
transition: 0.5s flex ease-in-out;
}
.text__description {
position: absolute;
opacity: 0;
transition: 0.4s opacity ease-in-out 0.1s;
}
.text__title {
border-bottom: 2px solid red;
}
.thumbnail-component:hover .text__content__top {
flex: 1;
}
.thumbnail-component:hover .text__content__top > * {
pointer-events: none;
}
.thumbnail-component:hover .text__description {
opacity: 1;
}
<div class="thumbnail-component">
<div class="text">
<div class="text__content">
<div class="text__content__top">
<p class="text__title">The movie title</p>
<p class="text__description">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<div class="text__content__bottom">
<p class="text__author">Published by Author</p>
</div>
</div>
</div>
</div>
jsFiddle

Related

Why do one grid cell is overlapping another grid cell?

I am currently trying to complete a challenge where I have encountered this issue-
I have selected certain rows and columns of the grid, but my subtitle-img class is still overlapping subtitle2 class.
Can anyone find the possible reason and solution to this problem?
My code:
body{
background: #DCE8FF;
font-family: 'Times New Roman', Times, serif;
animation: fadein 2s ease-in 0s 1 normal forwards;
}
.main-container{
display: grid;
grid-template-columns: 65% 30%;
column-gap: 5%;
}
.subtitle-content-grid{
display: grid;
grid-template-columns: auto auto auto;
grid-template-rows: auto auto auto auto;
}
.subtitle1{
grid-column-start: 1;
grid-column-end: span col2-end;
grid-row-start: 1;
grid-row-end: span 1;
}
.subtitle2{
grid-column-start: 1;
grid-column-end: span col2-start;
grid-row-start: 2;
grid-row-end: span 2;
}
.subtitle-img{
display: -ms-flexbox;
display: flex;
height: auto;
grid-column-start: 3;
grid-column-end: span col3-end;
grid-row-start: 2;
grid-row-end: span 4;
}
.sub-img{
display: -ms-flexbox;
display: flex;
justify-content: center;
flex: 100%;
max-width: 100%;
height: auto;
}
.image-gallery{
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
justify-content: center;
flex: 50%;
max-width: 60%;
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
#media screen and (min-width: 400px) and (max-width: 1000px) {
.image-gallery {
flex: 100%;
max-width: 100%;
}
}
.image{
margin-top: 8px;
vertical-align: baseline;
width: 46%;
padding: 5px 10px 5px 5px;
}
.sidebar-content{
background: #FFE3BF;
}
.post{
border: 2px solid #FBCA8B;
margin: 5px;
}
.post>h2,p,a{
padding-left: 4px;
}
.post>a:hover{
animation: colorChange 2s ease-out 0s infinite normal;
}
.footer{
background: linear-gradient(#DCE8FF,steelblue);
height: 550px;
}
.contact-form{
margin: 10% 10% 10% 10%;padding: 2% 0 0 0;
animation: slidein 2s ease-in 0s 1 normal forwards;
}
input[type=text], textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc; /* Gray border */
border-radius: 4px; /* Rounded borders */
box-sizing: border-box; /* Make sure that padding and width stays in place */
margin-top: 6px; /* Add a top margin */
margin-bottom: 16px; /* Bottom margin */
resize: vertical /* Allow the user to vertically resize the textarea (not horizontally) */
}
input[type=submit] {
background-color: rgb(39, 132, 247);
color: white;
font-weight: bold;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: rgb(25, 25, 157);
}
/*Animations*/
#keyframes colorChange{
0%{
color: rgba(0, 145, 255, 0.943);
}
50%{
color: rgb(74, 74, 233);
}
100%{
color: steelblue;
}
}
#keyframes fadein{
0%{
opacity: 0;
}
100%{
opacity: 1;
}
}
#keyframes slidein {
0%{
-webkit-transform:translateX(-100%);
-moz-transform:translateX(-100%);
-o-transform:translateX(-100%);
-ms-transform:translateX(-100%);
}
100%{
-webkit-transform:translateX(0);
-moz-transform:translateX(0);
-o-transform:translateX(0);
-ms-transform:translateX(0);
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="wsc.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Website Styling Challenge</title>
</head>
<body>
<div class="main-container">
<div class="main-content">
<h1>Welcome to this Challenge</h1>
<p>Here is your list of objectives:</p>
<ul>
<li>Lay out the Content & Sidebar</li>
<li>Create proper margin & spacing around items</li>
<li>Import & Use A Custom Font</li>
<li>Color Scheme: Blue & Orange (Use However you see fit)</li>
<li>Style text appropriately</li>
<li>change the background color of the sidebar</li>
<li>Style image grid however you see fit</li>
<li>Create borders around each sidebar items</li>
<li>Create grid/flexbox for image and text under "Subtitle"</li>
<li>Image grow on hover</li>
<li>Link color change on hover</li>
<li>Page animation sequence for main items (content, sidebar)</li>
</ul>
<p>Do not feel limited by the objective! change or append anything you like. Good Luck!</p>
<div class="subtitle-area">
<div class="subtitle-content-grid">
<div class="subtitle1">
<h2 class="subtitle">Subtitle 1</h2>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Cupiditate, debitis odit. Omnis esse ea aut nisi eos ab, ipsa qui labore sed facilis, quos perspiciatis voluptates aliquid fugiat exercitationem impedit!</p>
</div>
<div class="subtitle2">
<h2 class="subtitle">Subtitle 2</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Enim magni, quam fugit perspiciatis maiores molestias quo totam, saepe obcaecati quia, nulla itaque perferendis culpa suscipit reiciendis reprehenderit! Illum, sapiente earum!</p>
</div>
<div class="subtitle3">
<h2 class="subtitle">Topic 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum, officiis. Illum odio quos, magni quam illo modi rerum maxime et minus dolore autem, nihil veniam. Architecto aspernatur temporibus ipsam dolorem.</p>
<ol>
<li>Lorem</li>
<li>Ipsum</li>
<li>Dolor</li>
<li>amet consectetur adipisicing elit!</li>
</ol>
</div>
<div class="subtitle-img">
<img class="sub-img" src="https://picsum.photos/300/300">
</div>
</div>
</div>
<div class="image-gallery">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
<img class="image" src="https://picsum.photos/300/300">
</div>
</div>
<div class="sidebar-content">
<div class="post">
<h2>Post 1</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
Lorem ipsum dolor sit amet
</div>
<div class="post">
<h2>Post 2</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
Lorem ipsum dolor sit amet
</div>
<div class="post">
<h2>Post 3</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
Lorem ipsum dolor sit amet
</div>
<div class="post">
<h2>Post 4</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
Lorem ipsum dolor sit amet
</div>
<div class="post">
<h2>Post 5</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
Lorem ipsum dolor sit amet
</div>
<div class="post">
<h2>Post 6</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
Lorem ipsum dolor sit amet
</div>
</div>
</div>
<div class="footer">
<div class="contact-form">
<form action="/action_page.php">
<label >First name:</label><br>
<input type="text" id="fname" placeholder="Your First Name"><br>
<label >Last name:</label><br>
<input type="text" id="lname" placeholder="Your Last Name"><br><br>
<label for="subject">Subject</label>
<textarea id="subject" name="subject" placeholder="Write something.." style="height:200px"></textarea>
<input type="submit" value="Submit">
</form>
</div>
</div>
</body>
</html>
Try using this in .subtitle-img
grid-column-start: 3;
grid-column-end: span 3;
grid-row-start: 2;
grid-row-end: span 4;

How to use flexbox to get an image and text insid my border

I'm trying to recreate this but I'm stuck on getting the image and text to fit inside the innermost border. the final is supposed to have an outside border, an inside border, and a div that expands across the top. Then a picture that is 30% width of the top spanning div. Then text that is supposed to be width 70% of the top spanning div.
This is what I got so far HTML:
:root {
--winter-primary: #ffd110;
}
.outside-winter-border {
border: 2px solid var(--winter-primary);
margin: auto;
max-width: 1000px;
}
.insdie-winter-border {
border: 2px solid var(--winter-primary);
margin: 20px;
}
.wh {
background-color: var(--winter-primary);
padding: 30px;
}
.winter-image {
width: 30%;
float: left;
}
.wi {
width: 70%;
float: right;
}
<section class="winter">
<div class="outside-winter-border">
<div class="insdie-winter-border">
<div class="section-heading">
<div class="wh">
<h2>Winter</h2>
</div>
</div>
<div class="content-wrapper">
<div class="winter-image">
<div class="section-image">
<a href="winter.html">
<img src="assets/images/winter.jpg" alt="Winter Image">
</a>
</div>
</div>
<div class="wi">
<div class="section-content">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit dolore enim sequi dignissimos vel fugit reiciendis minus voluptatem nostrum, at repellat odio libero cum eveniet officiis, cumque veritatis, qui eaque.
</p>
</div>
</div>
</div>
</div>
</div>
</section>
The exact desired result is unclear. However, here is a version using flex that gets both the image and text within the border. Don't use float.
.outside-winter-border {
border: 2px solid var(--winter-primary);
margin: auto;
max-width: 1000px;
}
.insdie-winter-border {
border: 2px solid var(--winter-primary);
}
img {
height: 100%;
}
.wh {
display: inline-flex;
}
.insdie-winter-border {
display: flex;
align-items: center;
}
:root {
--winter-primary: #ffd110;
}
p {
margin-left: 1em;
}
.section-heading {
width: 100%;
background-color: var(--winter-primary);
text-align: center;
}
.section-heading>h2 {
margin: 0;
}
<section class="winter">
<div class="outside-winter-border">
<div class="section-heading">
<h2>Winter</h2>
</div>
<div class="insdie-winter-border">
<div class="wh">
<a href="winter.html">
<img src="https://dummyimage.com/125/000/fff" alt="Winter Image">
</a>
</div>
<div class="content-wrapper">
<div class="winter-image">
</div>
<div class="wi">
<div class="section-content">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit dolore enim sequi dignissimos vel fugit reiciendis minus voluptatem nostrum, at repellat odio libero cum eveniet officiis, cumque veritatis, qui eaque.
</p>
</div>
</div>
</div>
</div>
</div>
</section>
I think you can try this (insted of .winter-image and .wi ):
.content-wrapper {
display: flex;
}
.winter-image {
flex: 3;
}
.wi {
flex: 7;
}

Flip-Card CSS/HTML: The back of the card is not showing when flipped

Goal: I would like to have responsive cards within a container, or grid if it responds better, that flip. When flipped the card will show details about the person on the front of the card.
Tried: I am using W3Schools flip card information but the back does not show up.
https://www.w3schools.com/howto/howto_css_flip_card.asp
Code: What I have so far.
/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover (remove perspective if you don't want the 3D effect */
.flip-card {
background-color: transparent;
width: 20em;
height: 29em;
border: 1px solid #f1f1f1;
perspective: 1000px;
/* Remove this if you don't want the 3D effect */
}
/* This container is needed to position the front and back side */
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.8s;
transform-style: preserve-3d;
}
/* Do an horizontal flip when you move the mouse over the flip box container */
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
}
/* Position the front and back side */
.flip-card-front, .flip-card-back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
/* Safari */
backface-visibility: hidden;
}
.flip-card-front {
background-color: #bbb;
color: black;
}
/* Style the back side */
.flip-card-back {
background-color: dodgerblue;
color: white;
transform: rotateY(180deg);
}
<div class="container-fluid">
<h1>About Us</h1>
<div class="-card-deck card-columns">
<!-- Card: Dad (Owner) -->
<div id="dad-owner" class="card flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img class="img-fluid" src="<?= $pathStart ?>static/images/Dad3x4.png" alt="dad-owner">
<h4 class="card-title">Kyle Field</h4>
<p class="card-text">Owner</p>
</div>
</div>
<div class="flip-card-back">
<h4 class="card-title">About Me</h4>
<hr>
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat tenetur odio suscipit non
commodi
vel
eius veniam maxime?
</p>
</div>
</div>
<!-- Card: Kyle (Brother) -->
<div id="kyle-brother" class="card flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img class="img-fluid" src="<?= $pathStart ?>static/images/KyleField3x4.png" alt="kyle-brother">
<h4 class="card-title">About Me</h4>
<p class="card-text">Brother</p>
</div>
</div>
<div class="flip-card-back">
<h4 class="card-title">About Me</h4>
<p class="card-text"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat tenetur
odio suscipit non
commodi
vel
eius veniam maxime?</p>
</div>
</div>
<!-- Card: Alix Field (Sister) -->
<div id="alix-sister" class="card flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img class="img-fluid" src="<?= $pathStart ?>static/images/AlixField3x4.png" alt="alix-sister`">
<h4 class="card-title">Alix Field</h4>
<p class="card-text">Sister</p>
</div>
</div>
<div class="flip-card-back">
<h4 class="card-title">About Me</h4>
<hr>
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat tenetur odio suscipit non
commodi
vel
eius veniam maxime?
</p>
</div>
</div>
<!-- -->
<div id="ramsey-besty" class="card flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img class="img-fluid" src="<?= $pathStart ?>static/images/RamseyBond3x4.png" alt="ramsey-besty">
<h4 class="card-title">Ramsey Bond</h4>
<p class="card-text">Besty</p>
</div>
</div>
<div class="flip-card-back">
<h4 class="card-title">About Me</h4>
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat tenetur odio suscipit non
commodi
vel
eius veniam maxime?
</p>
</div>
</div>
</div>
</div>
The order of the nested div tags is important with the css rules:
/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover (remove perspective if you don't want the 3D effect */
.flip-card {
background-color: transparent;
width: 300px;
height: 200px;
border: 1px solid #f1f1f1;
perspective: 1000px; /* Remove this if you don't want the 3D effect */
}
/* This container is needed to position the front and back side */
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.8s;
transform-style: preserve-3d;
}
/* Do an horizontal flip when you move the mouse over the flip box container */
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
}
/* Position the front and back side */
.flip-card-front, .flip-card-back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden; /* Safari */
backface-visibility: hidden;
}
/* Style the front side (fallback if image is missing) */
.flip-card-front {
background-color: #bbb;
color: black;
}
/* Style the back side */
.flip-card-back {
background-color: dodgerblue;
color: white;
transform: rotateY(180deg);
}
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img class="img-fluid" src="<?= $pathStart ?>static/images/Dad3x4.png" alt="dad-owner">
<h4 class="card-title">Kyle Field</h4>
<p class="card-text">Owner</p>
</div>
<div class="flip-card-back">
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat tenetur odio suscipit non
commodi
vel
eius veniam maxime?
</p>
</div>
</div>
</div>
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img class="img-fluid" src="<?= $pathStart ?>static/images/Dad3x4.png" alt="dad-owner">
<h4 class="card-title">Kyle Field</h4>
<p class="card-text">Owner</p>
</div>
<div class="flip-card-back">
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat tenetur odio suscipit non
commodi
vel
eius veniam maxime?
</p>
</div>
</div>
</div>
You want both the flip-card-front and flip-card-back divs nested within the flip-card-inner div:
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<div class="flip-card-back">

Slick Carousel bigger width than parent element

I 've got the following code, and when I am viewing on mobile the Slick Carousel is bigger than the parent element and I couldn't fix it with any settings. I am using Boostrap as well.
<nav class="navbar fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
<img src="/assets/Intech Logo.png" alt="INTECH DYNAMICS logo" />
</a>
</div>
</nav>
<div class="wrapper-section-1">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-xl-6 col-xs-12 col-xm-12 d-flex justify-content-center imagine">
<img class="img img-fluid floating" src="/assets/Header Image.png" alt="Careers banner image" />
</div>
<div class="col-lg-6 col-md-6 col-xl-6 col-xs-12 col-xm-12 d-flex justify-content-center">
<div class="row">
<div class="col-lg-12 title">
<h1 class="text-title">CAREERS</h1>
</div>
<div class="col-lg-12 slide">
<div class="single-item slider slide">
<div>
<div class="font-italic">
Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Illo at reiciendis architecto harum nihil culpa accusantium
saepe ut, tempore quibusdam ex odit magnam nemo accusamus
numquam consequatur? Praesentium, voluptates pariatur!</div>
<br>
<span class="font-weight-bold">Darius Opro</span><span class="font-weight-normal"> Full Stack
Programmer</span>
</div>
<div>
<div class="font-italic">
Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Illo at reiciendis architecto harum nihil culpa accusantium
saepe ut, tempore quibusdam ex odit magnam nemo accusamus
numquam consequatur? Praesentium, voluptates pariatur!</div>
<br>
<span class="font-weight-bold">Cosmin Mihalache</span><span class="font-weight-normal"> Front End
Developer</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
The CSS looks like this:
.wrapper-section-1 {
font-family: IBMPlexSans-Medum;
color: white;
margin-top: 54px;
width: auto;
padding: 8vh;
background-image: linear-gradient(to right, #1c003b, #5216aa);
}
.img {
max-width: 70%;
height: auto;
}
.imagine {
padding: 30px 0 30px 0;
}
.title {
align-items: flex-end;
display: flex;
justify-content: flex-end;
}
.text-title {
margin-bottom: 2rem;
}
/* Slick Carousel */
.slick-prev:before,
.slick-next:before {
color: black;
}
.slick-slide {
transition: all ease-in-out 0.3s;
opacity: 0.2;
}
.slick-active {
opacity: 0.5;
}
.slick-current {
opacity: 1;
}
.slide {
width: 500px;
margin: 0;
text-align: right;
background-color: blue
}
/* Custom Arrows */
.prev-arrow {
position: absolute;
bottom: -50px;
left: 400px;
cursor: pointer;
}
.next-arrow {
right: 3px;
position: absolute;
bottom: -50px;
cursor: pointer;
}
/* Floating Animation */
.floating {
animation-name: floating;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
margin-left: 30px;
margin-top: 5px;
}
$(document).on("ready", function () {
$(".single-item").slick({
lazyLoad: "ondemand", // ondemand progressive anticipated
infinite: true,
settings: "unslick",
prevArrow:
'<span class="prev-arrow"><i class="fas fa-angle-left"></i></span>',
nextArrow:
'<span class="next-arrow"><i class="fas fa-angle-right"></i></span>',
});
});
I attached a photo to have a better idea of what is happening. I tried to give to the carousel padding, to set width in percentage with parent element but nothing worked.
Update: Pretty sure that JS has nothing to do with it but I attached anyway

Image should not use full-width in element

At the moment I am trying to program the wireframe I have made, but experience some problems with specially the left side of the element:
The problem is that the 200x200px image is going full width in the left column. Therefore I cannot center the image.
I can see it can be changed with overwriting the following CSS, and set the width to none;.
.cms-area img {
width: 100%;
}
But as I see it will break the reponsive on the images?
Can anybody help me in goal here?
See the [Testpage here][2].
The site is still using Bootstrap 3, and I do not have access to change the main CSS. Therefore I need to overwrite CSS if I need that.
Best regards
<style>
#front .row {
padding-bottom: 0px;
}
.row [class*="col-"] {
padding-right: 7.5px;
padding-left: 7.5px;
}
.padding-white-bg {
padding: 15px;
background-color: #fff;
margin-bottom:30px;
border: 1px solid #ebecf0;
}
.padding-twocolumn-bg {
margin-bottom:30px;
}
.padding-grey-bg {
padding: 7.5px;
}
.padding-white-border {
border: 1px solid #ebecf0;
}
.top-pad-d {
padding-top: 15px;
}
.sbp-2-column {
background-color:#fff;
padding-top:15px;
padding-bottom:15px;
border:1px solid #ebecf0;
}
/********************************/
/* Product styling */
/********************************/
/* Make spot image go full width */
.cms-area .result-cols ul.items li.add-item {
width: 100% !important;
}
.cms-area .result-cols ul.items li.add-item .item {
padding: 0px;
}
/* Remove add to basket button */
.cms-area .result-cols ul.items li.add-item a.button-add {
display:none;
}
/* Set height on product description */
.cms-area .result-cols ul.items li.add-item .desc {
height: 0px;
overflow: visible;
}
/* Remove fade on product headline */
.cms-area .result-cols ul.items li.add-item .desc:after {
background: none;
}
.cms-area .result-cols .more-wrap {
padding-bottom: 0px;
}
/* Remove Sub-heading */
.desc2{
display:none;
}
/* Remove product text */
.ext-description {
display:none;
}
/* Remove padding multiple products on row */
.cms-area .result-cols {
padding:0px;
}
/********************************/
/* Custom Buttons */
/********************************/
.btn.btn-lg {padding: 10px 40px;}
.btn.btn-hero,
.btn.btn-hero:hover,
.btn.btn-hero:focus {
color: #f5f5f5;
background-color: #1abc9c;
border-color: #1abc9c;
outline: none;
margin: 20px auto;
}
/********************************/
/* Media Queries */
/********************************/
#media screen and (min-width: 980px){
.hero { width: 980px; }
}
#media screen and (max-width: 640px){
.hero h1 { font-size: 4em; }
}
#media screen and (max-width: 896px){
.top-pad-m {
padding-top: 15px;
}
}
#media only screen and (max-width: 1280px) {
.fade-carousel .slides .slide-1,
.fade-carousel .slides .slide-2,
.fade-carousel .slides .slide-3 {
height: 60vh;
}
}
/********************************/
/* Overall Styling */
/********************************/
#sbp-hr {
margin-top:10px !important;
margin-bottom:10px !important;
}
.sbp-align {
text-align: left;
padding-left:10px;
}
.test {
padding:20px 20px 20px 20px;
}
/* TEST on 2 column */
.classWithPad { margin:8px; padding:10px; background-color: #fff; border:1px solid #ebecf0;}
.cms-area img {
max-width: 100%;
}
</style>
<div class="wrapper">
<!-- Section 7 -->
<div class="section padding-twocolumn-bg">
<div class="row">
<div class="text-center col-md-6">
<div class="classWithPad">
<p style="padding:75px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<a><img src="https://placehold.it/200x200" class="img-responsive test"></a>
</div>
</div>
<div class="text-center col-md-6">
<div class="classWithPad">
<div class="row">
<div class="col-sm-12">
<h3 class="sbp-align">Headline</h3>
<hr>
</div>
<div class="col-sm-6">
<img src="https://placehold.it/250x150" style="padding:10px;">
<h4 class="sbp-align">Subline</h4>
<p class="sbp-align">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<hr id="sbp-hr">
Read more
</div>
<div class="col-sm-6">
<img src="https://placehold.it/250x150" style="padding:10px;">
<h4 class="sbp-align">Subline</h4>
<p class="sbp-align">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<hr id="sbp-hr">
Read more
</div>
</div>
</div>
</div>
</div>
</div>
</div>
If you make width=200px to the left column the uploaded image will always be at center and there are lots of padding you are using for centering the images, you can use various classes of bootstrap for that!
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<div class="container-fluid">
<!-- Section 7 -->
<div class="section padding-two column-bg">
<div class="row align-items-center">
<div class="text-center col-md-6 col-12">
<div class="classWithPad">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<a><img src="https://placehold.it/200x200" width="200px"></a>
</div>
</div>
<div class="text-center col-md-6">
<div class="classWithPad">
<div class="row p-3">
<div class="col-sm-12">
<h3 class="sbp-align">Headline</h3>
<hr>
</div>
<div class="col-sm-6">
<img src="https://placehold.it/250x150" width="100%" class="pb-2">
<h4 class="sbp-align pb-2">Subline</h4>
<p class="sbp-align">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<hr id="sbp-hr">
Read more
</div>
<div class="col-sm-6">
<img src="https://placehold.it/250x150" width="100%" class="pb-2">
<h4 class="sbp-align">Subline</h4>
<p class="sbp-align">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<hr id="sbp-hr">
Read more
</div>
</div>
</div>
</div>
</div>
</div>
</div>