Animated images on WordPress - wordpress

I want these images above to pop up when someone hovers over them, each image pops up and comes to the center when someone hovers a mouse over the image, also they should be arranged in that format. I want to do this in WordPress, I am designing a website and the client wants that effect. Is it possible friends? please someone assist me.

HTML code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<nav>
<img src="http://winn-brown.co.uk/wp-content/uploads/2016/06/Logo-new.png" id="logo">
</nav>
<div class="wrapper">
<div class="parent" onclick="">
<div class="child bg-one">
Los Angeles
</div>
</div>
<div class="parent right" onclick="">
<div class="child bg-two">
London
</div>
</div>
<div class="parent" onclick="">
<div class="child bg-three">
New York
</div>
</div>
<div class="parent right" onclick="">
<div class="child bg-four">
Hollywood
</div>
</div>
<div class="parent" onclick="">
<div class="child bg-five">
Dubai
</div>
</div>
<div class="parent right" onclick="">
<div class="child bg-six">
San Francisco
</div>
</div>
</div>
CSS Code
/* Global Styling */
html, body {margin:0px; padding: 0px;}
nav {
background-color: #34495e;
height: 80px;
position: fixed;
width: 100vw;
top: 0;
z-index: 999;
}
#logo {height: 80px; margin-left: 20px;}
.wrapper {
padding: 50px 50px;
max-width: 1200px;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 80px;
}
.right {float: right !important;}
/* Image zoom on hover + Overlay colour */
.parent {
width: 45%;
margin: 20px;
height: 300px;
border: 1px solid blue;
overflow: hidden;
position: relative;
float: left;
display: inline-block;
cursor: pointer;
}
.child {
height: 100%;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
-webkit-transition: all .5s;
-moz-transition: all .5s;
-o-transition: all .5s;
transition: all .5s;
}
/* Several different images */
.bg-one {background-image: url(https://media.timeout.com/images/101602611/image.jpg);}
.bg-two {background-image: url(http://s1.it.atcdn.net/wp-content/uploads/2015/08/2-London.jpg);}
.bg-three {background-image: url(https://media.timeout.com/images/101484105/image.jpg);}
.bg-four {background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Hollywood_Sign.jpg/1280px-Hollywood_Sign.jpg);}
.bg-five {background-image: url(http://www.travelandleisure.com/sites/default/files/styles/tnl_redesign_article_landing_page/public/1453920892/DUBAI-554088081-ABOVE0116.jpg?itok=dcoZnCrc);}
.bg-six {background-image: url(http://blog.whitepages.com/wp-content/uploads/2015/04/san-franc.jpg);}
a {
display: none;
font-size: 35px;
color: #ffffff !important;
font-family: sans-serif;
text-align: center;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 50px;
cursor: pointer;
/*text-decoration: none;*/
}
.parent:hover .child, .parent:focus .child {
-ms-transform: scale(1.2);
-moz-transform: scale(1.2);
-webkit-transform: scale(1.2);
-o-transform: scale(1.2);
transform: scale(1.2);
}
.parent:hover .child:before, .parent:focus .child:before {
display: block;
}
.parent:hover a, .parent:focus a {
display: block;
}
.child:before {
content: "";
display: none;
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(52,73,94,0.75);
}
/* Media Queries */
#media screen and (max-width: 960px) {
.parent {width: 100%; margin: 20px 0px}
.wrapper {padding: 20px 20px;}
}
.hello {display: none}
You will try this using that code when you hover the image then it will be zoom out the image. I think it will help you.

Related

align flexbox items side-by-side (Aligning Problem)

So i am currently working on a website and i have a problem aligning the flexbox items(logo and title) in the header. They always align underneath each other and i need them side by side.
I read through the similar problems of others in stackoverflow and i also have googled for min. 2 hours.
I have to say learned many things about positioning and flexbox but i can't solve it.
There are many more things that i havent really cared about yet on the website but they don't matter for now, just overlook them :'D
But if you have some Tip's i still would be very thankful cause im new into creating websites :)
#import url('https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
#import url('https://fonts.googleapis.com/css?family=Sniglet');
#import url('https://fonts.googleapis.com/css?family=Dosis&display=swap');
#import url('https://fonts.googleapis.com/css?family=Dancing+Script');
/*all*/
html,
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
max-width: 100%;
box-sizing: border-box;
}
* {
box-sizing: inherit;
font-family: 'Dosis', sans-serif;
/*, cursive |zum kursiv*/
}
/*For PC's*/
#media screen and (min-width: 950px) {
.wrapper {
display: grid;
grid-template-columns: 100%;
grid-template-rows: auto auto auto;
/*NOT sur about the auto*/
grid-template-areas: "header" "main" "footer";
background-color: #ffc5c9;
}
/*Nav Menu*/
.navigation_wrapper {
position: relative;
}
.navigation_button {
will-change: transform;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
position: fixed;
z-index: 1;
top: 40px;
left: 100px;
background: transparent;
cursor: pointer;
}
.navigation_button .fa {
border: 2px solid white;
border-radius: 3px;
padding: 10px;
color: white;
}
.navigation_menu ul li {
list-style: none;
font-weight: 250;
color: #79E2DD;
/*font-family: impact; könnte hier noch geändert werden*/
}
.navigation_menu {
content: '';
position: fixed;
top: 0;
right: 0;
width: 50%;
background: white;
height: 100%;
transform: skewX(0deg) translate(100%, 0);
transform-origin: top right;
transition: all .2s ease-in;
z-index: -1;
}
.navigation_menu ul {
transform: skewX(-8deg);
transform-origin: top left;
position: fixed;
left: 100px;
top: 100px;
width: 400px;
text-align: left;
}
.navigation_menu ul li {
position: relative;
z-index: 999;
font-size: 32px;
color: #F4E1A6;
line-height: 64px;
}
.navigation_menu ul li a {
border: none;
color: #FFC59;
text-decoration: none;
}
.navigation_menu.active {
transform: skewX(8deg) translate(0, 0);
}
.navigation_menu li {
opacity: 0;
transform: translate(0, 10px);
transition: all .0s ease-in .3s;
}
.navigation_menu.active li {
opacity: 1;
transform: translate(0, 0);
transition: all 0.2s ease-in 0s;
}
.navigation_menu.active li:nth-child(1) {
transition-delay: .3s;
}
.navigation_menu.active li:nth-child(2) {
transition-delay: .4s;
}
.navigation_menu.active li:nth-child(3) {
transition-delay: .5s;
}
.navigation_menu.active li:nth-child(4) {
transition-delay: .6s;
}
.navigation_menu.active li:nth-child(5) {
transition-delay: .7s;
}
.navigation_menu.active li:nth-child(6) {
transition-delay: .8s;
}
/*Scrollbar*/
/*Skeleton*/
.head_wrapper {
grid-area: header;
height: auto;
padding: 3rem 5rem 3rem;
background-image: url("../pictures/TP4.jpeg");
background-size: cover;
background-repeat: no-repeat;
border-radius: 0 0 50px 50px;
}
.main_wrapper {
grid-area: main;
margin: 2rem;
padding: 20px;
min-height: 100%;
background-color: #feeee6;
border-radius: 50px;
}
.foot_wrapper {
background-color: #f4e1a6;
grid-area: footer;
border-radius: 50px 50px 0 0;
}
/*for Sticky Footer*/
.foot_wrapper,
.push {
height: 15rem;
}
/*flex containers*/
.head_flex_container {
display: flex;
justify-content: space-between;
flex-direction: column;
flex-wrap: wrap;
}
/*flex items*/
.head_titel_container {
border: 5px solid blue;
max-height: 22rem;
min-width: 100%;
position: relative;
}
.flex_titel {
position: absolute;
right: 0;
width: 78%;
box-sizing: content-box;
border: 5px solid black;
}
.flex_logo {
width: 22%;
box-sizing: border-box;
border: 5px solid pink;
}
/*Titles*/
h1 {}
h2 {}
/*Texts*/
.index {}
/*classes*/
/*ID's*/
#logo {
height: auto;
min-width: 5rem;
max-width: 20rem;
border-radius: 100%;
box-sizing: border-box;
}
#pb1 {}
/*Decoration*/
hr {}
}
<div class="wrapper">
<div class="scroll_wrapper">
<div class="scrollbar" id="style-default">
<div class="force-overflow"></div>
</div>
<div class="navigation_wrapper">
<div class="navigation_button">
<i class="fa fa-bars"></i>
</div>
<div class="navigation_menu">
<ul>
<li>Home</li>
<li>Gallerie</li>
<li>
Kontakt</li>
<li>
<a class="active" href="hier link rein"></a>
</li>
<li>
<a class="active" href="hier link rein"></a>
</li>
</ul>
</div>
</div>
<header>
<div class="head_wrapper">
<div class="head_flex_container">
<div class="head_titel_container">
<div class="flex_logo"><img src="pictures/Logo.jpeg" alt="Logo" title="El Pastelazo" id="logo"></div>
<div class="flex_titel">
<h1>El Pastelazo</h1>
</div>
</div>
</div>
</div>
</header>
<main class="main">
<div class="main_wrapper">
<div class="home_picture"><img src="pictures/PI.jpg" alt="Picture" title="Loah" id="pb1"></div>
<div class="pagetitle">
<h2>Home</h2>
</div>
<p class="index">
<h3>Wilkommen!</h2>
<hr class="hr_01"> hier kann loah sich und ihre arbeit bzw was Sie auf dieser Website macht eintragen. Damit dieser Text hier möglichst lang ist werde ich einfach irgend ein Scheiss labern. Eigentlich will ich ihn auch nicht wirklich möglichst lang machen sondern
nur so lang, wie auch ungefähr eine Vorstellung bzw Beschreibung sein würde. Ich würde mal sagen, diese länge an Text sollte genügen.
</p>
<div class="push"></div>
</div>
</main>
<footer>
<div class="foot_wrapper">
<a class="foot_item" href="https://www.instagram.com/el_pastelazo_/?hl=de" title="#el_pastelazo_"><i class="fab fa-instagram"></i></a>
<a class="foot_item" href="https://github.com/" title="Probably Insta"><i class="fa fa-github"></i></a>
<a class="foot_item" href="https://www.pinterest.de/" title="Pinterest"><i class="fa fa-pinterest-p"></i></a>
<a class="foot_item" href="https://www.gmx.ch/" title="Mail"><i class="fa fa-envelope-o"></i></a>
</div>
</footer>
</div>
Adding display:flex style to an HTML element by default make its children appear side by side unless you explicitly add flex-direction: column;.
After Looking at your html carefully I see that you have added display:flex to head_flex_container which has only one child i.e head_titel_container.
You could add display:flex property to head_titel_container because it has two children that needs to appear side by side.
<div class="head_titel_container">
<div class="flex_logo"><img src="pictures/Logo.jpeg" alt="Logo" title="El Pastelazo" id="logo"></div>
<div class="flex_titel"><h1>El Pastelazo</h1></div>
</div>
.head_titel_container {
display: flex;
}
Adding display: flex style to .head_titel_container in your css file should make them appear side by side.
Let me know if you have any problems with this approach.
Did you want something like this?
/*flex items*/
.head_titel_container{
border: 5px solid blue;
max-height: 22rem;
width: 50%;
min-width: 50%;
position: relative;
display: inline-block;
}
.flex_titel{
position: absolute;
left:800px;
top:-10px;
width: 78%;
box-sizing: content-box;
border: 5px solid black;
display: inline-block;
}
By the way, there's this website called JSFiddle where you can post your code for a quick demo. Might be useful in the future.

Border Radius Error only on Safari Browser

I am trying to make a node that can zoom its picture when hovered upon. Everything works fine on Chrome and Mozilla. However, for some reason Safari gets buggy every time the image is on hover. The border radius disappears when hovered into a sharp edge and reappears when un-hovered. Here is an example: FIDDLE
.img-zoom {
top: 0;
left: 0;
margin: 0;
display: block;
width: 100%;
height: 60%;
position: relative;
overflow: hidden;
}
.img-zoom img {
-webkit-transform: scale(1.04);
-ms-transform: scale(1.04);
transform: scale(1.04);
transition: all 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.img-zoom img:hover {
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.blogDesc {
background-color: whitesmoke;
width: 100%;
height: 40%;
}
.blogContent {
width: 200px;
height: 200px;
word-wrap: break-word;
border-radius:25px;
overflow: hidden;
display:inline-block;
margin:10px;
}
.blogTitle {
font-weight: bold;
font-family: "Courier New";
text-align: center;
padding: 10px;
}
.blogText {
-webkit-column-width: 150px;
column-width: 150px;
height: 100%;
margin-left: 10px;
margin-right: 10px;
}
.blogAlign{
text-align:center;
}
<section class="blogAlign">
<div class="blogContent">
<div class="img-zoom"><img src="https://kbob.github.io/images/sample-3.jpg" alt="" title=""></div>
<div class="blogDesc">
<div class="blogTitle">
My Multimedia Agency Tool
</div>
<div class="blogText">
BBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLAB
</div>
</div>
</div>
<div class="blogContent">
<div class="img-zoom"><img src="https://kbob.github.io/images/sample-3.jpg" alt="" title=""></div>
<div class="blogDesc">
<div class="blogTitle">
My Multimedia Agency Tool
</div>
<div class="blogText">
BBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLAB
</div>
</div>
</div>
<div class="blogContent">
<div class="img-zoom"><img src="https://kbob.github.io/images/sample-3.jpg" alt="" title="" class="picturez"></div>
<div class="blogDesc">
<div class="blogTitle">
My Multimedia Agency Tool
</div>
<div class="blogText">
BBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLABBBLALBLABLALBALBLBALBALBALBLABLABLABLABLABLALBLABLABLABLALBALBLABLABLABLABLALBLAB
</div>
</div>
</div>
</section>
Does anyone know how to fix this? Thanks in advance.
<div class="activity_rounded"><img src="http://placehold.it/100" /></div>
.activity_rounded {
display: inline-block;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-khtml-border-radius: 50%;
border: 3px solid #fff;
}
.activity_rounded img {
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-khtml-border-radius: 50%;
vertical-align: middle;
}
it should work properly.

Text on hover slide in left transition

I have an image gallery with some hover affects that I want to refine. When the user hovers on an image, the other pictures in the gallery get dimmed out. But I also want some text to slide in from the left on hover as well. Something like this website has http://gugroppo.com/projects.
I have the text appear on hover but I can't get it to transition in from the left smoothly; or have my overlay effect appear smoothly as well. Everything just appears. Here's my codepen.
window.sr = ScrollReveal({reset: true});
sr.reveal('img', {mobile:true});
body {
margin: 0;
padding: 0;
}
h2 {
padding-bottom: 7.5%;
color: #7bbe9a;
text-align: center;
font-size: 1.875em;
font-family: 'Lato', sans-serif;
}
.gallery{
width: 100%;
display: inline-block;
flex-wrap: wrap;
justify-content: center;
padding-top: 7.5%;
padding-bottom: 15%;
background-color: #333;
}
.img-container {
-webkit-transition: opacity 0.3s;
-moz-transition: opacity 0.3s;
-ms-transition: opacity 0.3s;
-o-transition: opacity 0.3s;
transition: opacity 0.3s;
width: 33.33%;
float: left;
display: block;
position: relative;
}
.img-container img{
display: block;
width: 100%;
height: auto;
}
#slide {
position: absolute;
left: -100px;
transition: 1s;
width: 100%;
height: 100%;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
right: 0;
bottom: 0;
opacity: 0;
/* background: rgba(123, 190, 154, 0.72); */
background: rgba(51,51,51, 0.2);
}
.text {
color: white;
position: absolute;
top: 50%;
left: 50%;
font-size: 24px;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
font-family: 'Lato', sans-serif;
}
#parent:hover > .img-container:not(:hover) {
opacity: 0.3;
}
.img-container:hover .overlay {
opacity: 1;
}
#media(max-width:768px){
.img-container {
width: 100% !important;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://unpkg.com/scrollreveal/dist/scrollreveal.min.js"></script>
<body>
<a class="anchor" name="portfolio">
<div class="gallery">
<h2>Portfolio</h2>
</a>
<div id="parent">
<div class="img-container">
<a href="">
<img src="https://img1.cgtrader.com/items/4716/33d9798412/large/wicker-laundry-basket-3d-model-obj-3ds-c4d.jpg" alt=""></a>
<div class="overlay">
<div class="text">Basket</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="https://cdn.shopify.com/s/files/1/0225/1115/products/buildings-rts-orc-smithy-low-poly-3d-model-2_400x.jpeg?v=1456744435" alt=""></a>
<div class="overlay">
<div class="text">Train</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="http://www.pycomall.com/images/P1/Bed_Room_Interior_3D_Model_in_Max_format_7.jpg" alt=""></a>
<div class="overlay">
<div class="text">Bed</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="http://mycreativedaddy.com/wp-content/uploads/chair-capitone-3d-model.jpg" alt=""></a>
<div class="overlay">
<div class="text">Chair</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="http://www.pycomall.com/images/P1/Restaurant_Interior_3D_Model_in_Max_format_4.jpg" alt=""></a>
<div class="overlay">
<div class="text">Room</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="https://3dexport.com/items/2008/07/29/11820/9454/wedding_ring._3d_model_c4d_max_obj_fbx_ma_lwo_3ds_3dm_stl_66996.jpg" alt=""></a>
<div class="overlay">
<div class="text">Ring</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="http://www.madsonline.net/wp-content/uploads/2017/07/living-room-interior-3d-model-in-max-format-3-3d-models-in-3d-living-room-model.jpg" alt=""></a>
<div class="overlay">
<div class="text">Couch</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="https://d1a9v60rjx2a4v.cloudfront.net/2013/10/03/00_54_27_730_00_1.jpg" alt=""></a>
<div class="overlay">
<div class="text">Glass</div>
</div>
</div>
<div class="img-container">
<a href="">
<img src="https://img1.cgtrader.com/items/5185/bb5b9f2fde/large/bailarina-3d-model-obj-3ds-fbx-ma-mb.jpg" alt=""></a>
</div>
</div>
</body>
What you want to do is add overflow: hidden to your container
.img-container{overflow: hidden;}
Then initially start the text off the element. I did this by setting
.text{left: -50%;}
Finally you need to call the text back into the element on hover by using container:hover and setting the text back to 50%;
.img-container:hover .text{left: 50%;}
Lastly you will just need to add in some transition properties and attributes of your likely. Hope this helps.
The follow CSS should accomplish what you are looking for
body {
margin: 0;
padding: 0;
}
h2 {
padding-bottom: 7.5%;
color: #7bbe9a;
text-align: center;
font-size: 1.875em;
font-family: 'Lato', sans-serif;
}
.gallery{
width: 100%;
display: inline-block;
flex-wrap: wrap;
justify-content: center;
padding-top: 7.5%;
padding-bottom: 15%;
background-color: #333;
}
.img-container {
-webkit-transition: opacity 0.3s;
-moz-transition: opacity 0.3s;
-ms-transition: opacity 0.3s;
-o-transition: opacity 0.3s;
transition: opacity 0.3s;
width: 33.33%;
float: left;
display: block;
position: relative;
overflow: hidden;
}
.img-container img{
display: block;
width: 100%;
height: auto;
}
#slide {
position: absolute;
left: -100px;
transition: 1s;
width: 100%;
height: 100%;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
right: 0;
bottom: 0;
opacity: 0;
/* background: rgba(123, 190, 154, 0.72); */
background: rgba(51,51,51, 0.2);
}
.text {
color: white;
position: absolute;
top: 50%;
left: -50%;
font-size: 24px;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
font-family: 'Lato', sans-serif;
}
.img-container:hover .text {
left: 50%;
}
#parent:hover > .img-container:not(:hover) {
opacity: 0.3;
}
.img-container:hover .overlay {
opacity: 1;
}
#media(max-width:768px){
.img-container {
width: 100% !important;
}
}

Evenly distribute scaled items?

How can I modify the styles below to result in the elements having the same spacing between each after the scaling? (without absolutely positioning them)
Desired Result:
.menu-next, .menu-previous1 {
transform: scale(.9); transform-origin: left;
}
.menu-previous2 { transform: scale(.7); transform-origin: left;}
.menu-previous3 { transform: scale(.55); transform-origin: left;}
.menu {
background-color: gray;
padding: 10px;
}
.menu div {
display: block;
width: 20%;
padding: 10px;
background-color: white;
color: green;
}
<div class="menu">
<div class="menu-previous3">Items</div>
<div class="menu-previous2">Store</div>
<div class="menu-previous1">Friends</div>
<div class="menu-current" >Settings</div>
<div class="menu-next" >Other</div>
</div>
Use scale(x, y) and not scale(value) + transform-origin
.menu-next,
.menu-previous1 {
transform: scale(.9, 1);
transform-origin: left;
}
.menu-previous2 {
transform: scale(.7, 1);
transform-origin: left;
}
.menu-previous3 {
transform: scale(.55, 1);
transform-origin: left;
}
.menu {
display: flex;
flex-direction: column;
justify-content: center;
background-color: gray;
padding: 10px;
}
.menu div {
display: block;
width: 20%;
padding: 10px;
background-color: white;
border: 1px solid green;
color: green;
}
<div class="menu">
<div class="menu-previous3">Items</div>
<div class="menu-previous2">Store</div>
<div class="menu-previous1">Friends</div>
<div class="menu-current">Settings</div>
<div class="menu-next">Other</div>
</div>
With thatthere is an other problem : scalling text. But you can fix that with pseudo-element (like here)
The best way is to wrap the scaling items and apply the other ui properties seperately of items to that wrapping div and then apply the scaling to the item inside it only.
Here is your code with this theory applied and a little change of padding and margin for equal spacing:
.itemwrapper .menu-next, .itemwrapper .menu-previous1 {
transform: scale(.9); transform-origin: left;
}
.itemwrapper .menu-previous2 { transform: scale(.7); transform-origin: left;}
.itemwrapper .menu-previous3 { transform: scale(.55); transform-origin: left;}
.menu {
background-color: gray;
padding: 10px;
}
.itemwrapper{
display: block;
width: 20%;
padding: 5px 10px;
margin:2px;
background-color: white;
color: green;
}
<div class="menu">
<div class="itemwrapper"><div class="menu-previous3">Items</div></div>
<div class="itemwrapper"><div class="menu-previous2">Store</div></div>
<div class="itemwrapper"><div class="menu-previous1">Friends</div></div>
<div class="itemwrapper"><div class="menu-current" >Settings</div></div>
<div class="itemwrapper"><div class="menu-next" >Other</div></div>
</div>
Hope this helps.
May be you can adjust it by hand ... Not really a good solution, but it is difficult to go any better.
.menu-next,
.menu-previous1 {
transform: scale(.9);
}
.menu-previous2 {
transform: scale(.7);
margin-bottom: -6px;
}
.menu-previous3 {
transform: scale(.55);
margin-bottom: -12px;
}
.menu {
background-color: gray;
padding: 10px;
}
.menu div {
display: block;
width: 20%;
padding: 10px;
background-color: white;
color: green;
transform-origin: left;
}
<div class="menu">
<div class="menu-previous3">Items</div>
<div class="menu-previous2">Store</div>
<div class="menu-previous1">Friends</div>
<div class="menu-current">Settings</div>
<div class="menu-next">Other</div>
</div>
Based a bit off this answer and sort of hack-y: https://stackoverflow.com/a/16388428/1204415
Wrap your scaled divs, resize the wrappers, and move the scaled divs with negative margins within the wrappers. scale() seems to also scale borders, margins, and padding.
HTML
<div class="menu">
<div class="wrap1">
<div class="item menu-previous3">Items</div>
</div>
<div class="wrap2">
<div class="item menu-previous2">Store</div>
</div>
<div class="item menu-previous1">Friends</div>
<div class="item menu-current" >Settings</div>
<div class="item menu-next" >Other</div>
</div>
CSS
.wrap1 {
height: 20px;
margin: 0;
overflow: hidden;
background-color: black;
}
.wrap2 {
height: 32px;
margin: -5px 0 0 0;
overflow: hidden;
background-color: blue;
}
.menu-next, .menu-previous1 {
transform: scale(.9); transform-origin: left;
}
.menu-previous2 { transform: scale(.7); transform-origin: left;}
.menu-previous3 { transform: scale(.55); transform-origin: left; margin: -8px 0 0 0; }
.menu {
background-color: gray;
padding: 10px;
}
.menu .item {
display: block;
outline:1px solid red;
width: 20%;
padding: 10px;
background-color: white;
color: green;
}
A pen: https://codepen.io/dmoz/pen/vmjybo

Alining flipping cards in CSS HTML

I am making images with text on flipping cards. I am trying to put them on the site so there would be about nine of them, each time three of them next to one another. Here is my code. Please just simply directly tell me how to implement it as I did not manage to fix the issue myself beforehand. I have no exp with HTML or CSS and just need a quick fix for the site. Thanks!
So the HTML bit in the end will be reproduced about nine times, the implementation has to be efficient for each copy.
<style> #f1_container {
position: margin-left;
margin: 10px;
width: 150%;
height: 150%;
z-index: 1;
}
#f1_container {
perspective: 1000;
}
#f1_card {
width: 113px;
height: 170px;
transform-style: preserve-3d;
transition: all 1.0s linear;
}
#f1_container:hover #f1_card {
transform: rotateY(180deg);
box-shadow: -5px 5px 5px #aaa;
}
.face {
position: absolute;
width: 150%;
height: 150%;
backface-visibility: hidden;
}
.face.back {
display: block;
transform: rotateY(180deg);
box-sizing: border-box;
padding: 10px;
color: white;
text-align: center;
background-color: #aaa;
}
</style>
<div id="f1_container">
<div id="f1_card" class="shadow">
<div class="front face">
<img src="http://img11.hostingpics.net/pics/714153square1.png"/>
</div>
<div class="back face center">
<p>TContent</p>
<p>Content</p>
</div>
.cardCont {
display: inline-block;
padding: 20px;
}
/*sets transition speed for the card flip you can change this*/
.Card {
height: 150px;
width: 150px;
border: 1px solid black;
transition: all .4s;
}
/*rotates on hover of outer div*/
.cardCont:hover .Card {
transform: rotateY(-180deg);
}
/*sets transitions for the front and back.. delay should half the transition this way this will only show when the card is half flipped*/
.Card .front,
.Card .back {
transition: all .1s;
transition-delay: .2s;
}
/*fixes the fact that this will now be backwards and hides it normally*/
.Card .back {
transform: rotateY(180deg);
display: none;
width: 100%;
}
/*following 2 set default properties for the front and back.*/
.cardCont:hover .Card .front {
display: none;
}
.cardCont:hover .Card .back {
display: inline-block;
}
<div class="cardCont">
<div class="Card">
<div class="front">Card1 Front
<br />you can put what you want in here.. this is the front</div>
<div class="back">Card1 Back
<br />you can put what you want in here.. this is the back</div>
</div>
</div>
<div class="cardCont">
<div class="Card">
<div class="front">Card2 Front
<br />you can put what you want in here.. this is the front</div>
<div class="back">Card2 Back
<br />you can put what you want in here.. this is the back</div>
</div>
</div>

Resources