I have implemented a flip card. It has a button. Everything works fine but not the button. If I removed the css out of the entire thing, the button works but obviously I lose the effects and flip. I even tried putting a link on the entire image, still the link doesn't work. It looks like something is preventing link in this entire thing. What am I doing wrong?
Fiddle Link
<style type="text/css">
.flip-card {
-webkit-perspective: 1000;
perspective: 1000;
border: 0;
background: transparent;
}
.flip-card:hover .flip-card-inner,
.flip-card:hover .flip-card-inner {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flip-card,
.flip-card-inner-front,
.flip-card-inner-back {
width: 100%;
height: 8rem;
}
.flip-card-inner {
transition: 0.6s;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
position: relative;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip-card-inner-front,
.flip-card-inner-back {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.flip-card-inner-front {
background-size: cover;
background-repeat: no-repeat;
z-index: 2;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.flip-card-inner-front span {
width: 100%;
text-align: center;
background: rgba(254, 254, 254, 0.8);
padding: 0.25rem 0;
font-size: 1.25rem;
font-weight: bold;
}
.flip-card-inner-back {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
text-align: center;
background: #cacaca;
padding: 1rem;
}
.flip-card-inner-back-title {
font-weight: bold;
}
.flip-card-inner-back-text {
line-height: 1.3;
}
</style>
html
<div class="row">
<div class="col-6 col-sm">
<div class="flip-card card" ontouchstart="this.classList.toggle('hover');">
<div class="flip-card-inner">
<div class="flip-card-inner-front" style="background-image: url('images/logobgs/merc200.jpg')"></div>
<div class="flip-card-inner-back" style="background-image: url('images/logobgs/logobg.jpg')"><img class="img-fluid" src="images/logos/merc.png" width="70" height="70"><br><button class="bg-warning"><small>View Mercedes Cars</small></button></div>
</div>
</div></div>
Related
I want to implement scrolling animations like below in React & Nextjs (and I am using TailwindCSS)
Not sure how to explain this effect (scroll -> stack -> appear), but the user scroll down, and the next part shows up in a fixed place. Then, once it scrolls to a certain point, it starts moving.
I assume it is a combination of the z-index but not sure how to implement it.
Here is the above site I found and want to know how to achieve this kind of scrolling effect.
https://www.abstract.com/
It is done with the help of position: sticky; at block two class="s-heading-first".
.section.s-heading-first {
position: -webkit-sticky;
position: sticky;
bottom: 0%;
display: flex;
padding-top: 27rem;
padding-bottom: 1rem;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
-webkit-box-pack: end;
justify-content: flex-end;
}
I think that can help you.
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
section {
display: block;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
height: 100%;
}
body {
margin: 0;
min-height: 100%;
background-color: #fff;
font-family: "Gt america standard", sans-serif;
color: #000;
font-size: 1rem;
line-height: 1.5;
}
h2 {
font-weight: bold;
margin-bottom: 10px;
font-size: 32px;
line-height: 36px;
margin-top: 20px;
}
p {
margin-top: 0;
margin-bottom: 10px;
}
h2 {
margin-top: 0px;
margin-bottom: 0rem;
font-size: 32px;
line-height: 30px;
font-weight: 700;
}
.section {
position: relative;
padding-right: 2.5rem;
padding-left: 2.5rem;
}
.section.s-hero {
z-index: 10;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
min-height: 100vh;
margin-top: 0rem;
padding-top: 10rem;
padding-bottom: 7.5rem;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
background-color: #000;
-webkit-transform: translate3d(0px, 0px, 10px);
transform: translate3d(0px, 0px, 10px);
color: #fff;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.section.s-radius {
padding-top: 0rem;
padding-bottom: 15rem;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
border-bottom-left-radius: 5rem;
border-bottom-right-radius: 5rem;
}
.section.s-radius.sr-large {
padding-top: 4rem;
}
.section.s-heading {
position: -webkit-sticky;
position: sticky;
bottom: 0%;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding-top: 22.5rem;
padding-bottom: 1rem;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.section.s-heading-first {
position: -webkit-sticky;
position: sticky;
bottom: 0%;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding-top: 27rem;
padding-bottom: 1rem;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.flex-grid {
position: relative;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.col {
position: relative;
padding-right: 1rem;
padding-bottom: 2rem;
padding-left: 1rem;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
.heading-xl {
margin-top: 0px;
font-size: 5rem;
line-height: 0.95;
font-weight: 400;
letter-spacing: -0.05em;
}
.col-wrapper {
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
margin-right: -1rem;
margin-bottom: -2rem;
margin-left: -1rem;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.col-12-d {
-webkit-box-flex: 0;
-webkit-flex: 0 0 100%;
-ms-flex: 0 0 100%;
flex: 0 0 100%;
}
.text-center {
text-align: center;
}
.section-radius {
position: absolute;
left: 0%;
top: 100%;
right: 0%;
z-index: 1;
width: 100%;
height: 5rem;
margin-top: -1px;
border-bottom-left-radius: 5rem;
border-bottom-right-radius: 5rem;
background-color: #000;
}
.main {
position: relative;
height: 100%;
}
.background-white {
background-color: #fff;
}
.background-blurple {
background-color: #dadbf1;
}
.container-max {
position: relative;
width: 100%;
max-width: 100rem;
margin-right: auto;
margin-left: auto;
}
.heading-lines {
position: absolute;
left: 0%;
top: 0%;
right: 0%;
bottom: 0%;
}
.heading-line {
position: relative;
bottom: 0.7rem;
height: 4.9rem;
border-bottom: 2px solid #b3b8ee;
}
.heading-line.hl-first {
border-top: 2px solid #b3b8ee;
}
.z-9 {
position: relative;
z-index: 9;
-webkit-transform: translate3d(0px, 0px, 9px);
transform: translate3d(0px, 0px, 9px);
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.z-7 {
position: relative;
z-index: 7;
-webkit-transform: translate3d(0px, 0px, 7px);
transform: translate3d(0px, 0px, 7px);
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.section-head-bg-extension {
position: absolute;
left: 0%;
top: -5rem;
right: auto;
bottom: auto;
width: 100%;
height: 5rem;
}
.c-body {
font-size: 16px;
line-height: 1.4;
letter-spacing: -0.02em;
}
#media screen and (min-width: 1280px) {
.container-max {
overflow: visible;
}
}
#media screen and (min-width: 1440px) {
.section {
padding-right: 5rem;
padding-left: 5rem;
}
}
#media screen and (min-width: 1920px) {
body {
font-size: 1.25rem;
line-height: 1.4;
}
.heading-xl {
font-size: 6.5rem;
line-height: 0.98;
}
.heading-line {
bottom: 0.8rem;
height: 6.9rem;
}
.c-body {
font-size: 20px;
}
}
#media screen and (max-width: 991px) {
.section.s-hero {
height: 100%;
padding-right: 2.5rem;
padding-left: 2.5rem;
}
.section.s-heading {
padding-top: 30vh;
}
.section.s-heading-first {
padding-top: 30vh;
}
.heading-xl {
font-size: 4rem;
line-height: 1;
}
.container-max {
max-width: none;
}
}
#media screen and (max-width: 767px) {
.section {
padding-right: 2rem;
padding-left: 2rem;
}
.section.s-hero {
padding-right: 2rem;
padding-left: 2rem;
}
.section.s-hero.s-hero-versions {
padding-bottom: 0rem;
}
.section.s-radius {
padding-bottom: 7.5rem;
border-bottom-left-radius: 2.5rem;
border-bottom-right-radius: 2.5rem;
}
.section.s-heading {
padding-top: 7.5rem;
}
.section.s-heading-first {
padding-top: 15vh;
}
.heading-xl {
font-size: 3rem;
line-height: 1;
font-weight: 500;
}
.hide-mobile-wide {
display: none;
}
.section-radius {
height: 2.5rem;
border-bottom-left-radius: 2.5rem;
border-bottom-right-radius: 2.5rem;
}
.z-9 {
-webkit-transform: translate3d(0px, 0px, 9px);
transform: translate3d(0px, 0px, 9px);
}
.z-7 {
-webkit-transform: translate3d(0px, 0px, 7px);
transform: translate3d(0px, 0px, 7px);
}
.section-head-bg-extension {
top: -2.5rem;
height: 2.5rem;
}
}
#media screen and (max-width: 479px) {
.section {
padding-right: 1.5rem;
padding-left: 1.5rem;
}
.section.s-hero {
padding-right: 1.5rem;
padding-left: 1.5rem;
}
.heading-xl {
font-size: 2.75rem;
}
}
<body class="c-body">
<div class="page">
<div id="content" class="main">
<section class="section s-hero s-hero-versions">
<div class="section-radius"></div>
<div class="container-max">
container-max
</div>
</section>
<div class="section s-heading-first background-blurple z-9">
<div class="container-max">
<div class="flex-grid">
<div class="col-wrapper">
<div class="col col-12-d">
<div class="heading-lines hide-mobile-wide">
<div class="heading-line hl-first"></div>
<div class="heading-line"></div>
</div>
<div class="flex-grid">
Template
</div>
</div>
</div>
</div>
</div>
</div>
<section class="section s-radius sr-large background-blurple z-9">
<div class="container-max">
<div class="flex-grid">
<p>
Template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template,
template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template, template
</p>
</div>
</div>
</section>
<div class="section s-heading background-white z-7">
<div class="section-head-bg-extension background-white"></div>
<div class="container-max">
<h2 class="heading-xl text-center">Template text-center</h2>
</div>
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
</body>
I am really new to working on this, the problem I have is two
What I am trying to do is give it to show the menu as shown in the following image:
I can not put the option that was selected underlined, and so that the displayed menu is horizontal, what I have is this:
Searching the web I have not found anything to solve it or something to take an example to solve my problem, I am working with CSS and Vue.Js, if someone can tell me how to solve this
Underline the selected menu and see the menu displayed horizontally
My Code:
<div class="panel-group" id="accordion-mbl-menu">
<div class="panel">
<b-navbar-toggle target="collapse-cat-lvl1-469">
Accesorios
<img src="#/assets/images/layout/menu/chevron.svg" class="icon">
</b-navbar-toggle>
<div style="background-color:white;">
<b-collapse id="collapse-cat-lvl1-469">
<div data-cat-acc="473" class="grid-item parent-lvl-2">
<a class="link -1 grid-sty-1" href="#" target="_self" data-menu-item-id="473">
<span class="text">GTI</span>
</a>
</div>
...
(other menu options)
...
</b-collapse>
</div>
</div>
<div class="panel">
<button type="button" class="navbar-toggler collapsed"> ¿Necesitas ayuda? </button>
</div>
</div>
My code CSS
#media (max-width: 828px) {
#menu-header.show {
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#menu-header {
display: block ;
position: fixed;
z-index: 1;
background-color: #FFF;
left: 0;
top: 100px;
height: -webkit-calc(100% - 50px);
height: -moz-calc(100% - 50px);
height: calc(100% - 50px);
width: 90%;
padding: 20px 20px;
max-width: 87.5%;
transform: translateX(-100%);
transition: transform 650ms ease;
.grid-sty-1 {
height: 55px;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
-moz-box-align: center;
align-items: center;
height: 40px;
font-size: 16px;
font-family: "VWHead-Bold", sans-serif;
position: relative;
a{
text-decoration: none;
outline: none !important;
padding-right: 15px;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
}
> .text {
padding-left: 15px;
color: #001E50;
}
}
.navbar-greetings{
font-family: 'VWHead-Regular';
font-size: 24px;
line-height: 29px;
display: flex;
align-items: center;
color: #001E50;
}
#accordion-mbl-menu {
margin: 0;
.panel {
box-shadow: none !important;
background-color: transparent;
border-radius: 0;
border: 0;
margin-bottom: 0;
> button.collapsed {
color: #001e50;
> .icon{
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
}
> button.not-collapsed > .icon {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
> button {
margin: 0px;
padding: 0px;
width: 100%;
height: 55px;
font-size: 20px;
font-family: "VWHead-Bold";
font-weight: normal;
color: #2f3538;
text-decoration: none;
outline: none !important;
border-bottom: 1px solid #dee1e3;
padding-right: 15px;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
> .icon {
width: 20px;
height: 20px;
fill: currentColor;
-webkit-transition: all 350ms ease;
transition: all 350ms ease;
position: absolute;
right: 15px;
top: auto;
}
.collapse.in {
display: block;
}
}
}
}
}
}
Any way to style this?
To show underline on hover
.class:hover {
text-decoration: underline;
}
To display horizontal
.container {
display: flex;
flex-direction: row;
}
I have simple navigation bar with position:sticky that displays not clear when scrolled and everything seems to work fine then it is in the top.
As you can see from the images above there seems to be some render problem. Here is the css:
body{
/*For demo purpose*/
height:300vh;
}
* {
font-family: RobotoThin;
margin: 0;
padding: 0;
overflow-x: hidden;
outline: none;
-webkit-transition: 1s;
transition: 1s;
box-sizing: border-box;
background-repeat: no-repeat;
transition: 0.5s !important;
scroll-behavior: smooth;
}
div.window {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
box-sizing: border-box;
padding: calc(2vh + 2vw);
height: 100vh;
width: 95vw;
position: absolute;
right: 0;
top: 0;
display: none;
white-space: nowrap;
display: flex;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
background-color: #ecf0f1;
margin-left: 5vw;
}
#help{
display:block;
transition:0s !important;
}
div#help{
height:200vh;
white-space: normal;
}
div#help a{
color:red;
text-decoration: none;
}
div#nav {
top: 0;
position: sticky;
display: flex;
justify-content: space-between;
color: black;
background-color: white;
padding-top: 1vmax;
padding-bottom: 1vmax;
font-size: 1.2vmax;
flex-wrap: wrap;
border-radius: 10em;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
div#nav>a {
color: black;
}
div#nav>*:hover {
color: gold;
letter-spacing: 0.3vw;
}
div#nav> :first-child {
margin-left: 1vw;
}
div#nav> :last-child {
margin-right: 1vw;
}
<body>
<div class='windows' id='help'>
<div id='nav'> <a>General important info</a> <a>Desktop</a> <a>Math calculators</a> <a>Notes</a> <a>Battery</a> <a>Quotes</a> <a>Settings</a> <a>Passwords and Data</a> </div>
</div>
</body>
Don't mind the color. I use a plugin so you will see everything in white, not in black.
Strangely I couldn't get the example to work properly and I can not represent the issue. Hopefully you can take a look at my code and tell what may cause this problem.
After much fiddling, the culprit is:
overflow-x: hidden;
body {
/*For demo purpose*/
height: 300vh;
}
* {
font-family: RobotoThin;
margin: 0;
padding: 0;
/* overflow-x: hidden; <-- The problem */
outline: none;
-webkit-transition: 1s;
transition: 1s;
box-sizing: border-box;
background-repeat: no-repeat;
transition: 0.5s !important;
scroll-behavior: smooth;
}
div.window {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
box-sizing: border-box;
padding: calc(2vh + 2vw);
height: 100vh;
width: 95vw;
position: absolute;
right: 0;
top: 0;
display: none;
white-space: nowrap;
display: flex;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
background-color: #ecf0f1;
margin-left: 5vw;
}
#help {
display: block;
transition: 0s !important;
}
div#help {
height: 200vh;
white-space: normal;
}
div#help a {
color: red;
text-decoration: none;
}
div#nav {
top: 0;
position: sticky;
display: flex;
justify-content: space-between;
color: black;
background-color: white;
padding-top: 1vmax;
padding-bottom: 1vmax;
font-size: 1.2vmax;
flex-wrap: wrap;
border-radius: 10em;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
div#nav>a {
color: black;
}
div#nav>*:hover {
color: gold;
letter-spacing: 0.3vw;
}
div#nav> :first-child {
margin-left: 1vw;
}
div#nav> :last-child {
margin-right: 1vw;
}
<body>
<div class='windows' id='help'>
<div id='nav'> <a>General important info</a> <a>Desktop</a> <a>Math calculators</a> <a>Notes</a> <a>Battery</a> <a>Quotes</a> <a>Settings</a> <a>Passwords and Data</a> </div>
</div>
</body>
I have the following html :
<html>
<head>
<title>asd</title>
</head>
<body>
<div class="wrapper">
<div class="slide slide1"></div>
<div class="slide slide2"></div>
<div class="slide slide3"></div>
<div class="slide slide4"></div>
</div>
</body>
</html>
and the following css :
* { box-sizing: border-box; }
.wrapper {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: stretch;
justify-content: center;
}
.slide {
position: relative;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
width: 100%;
height: 100vh;
transition: all 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
webkit-transition: all 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.slide1 {
background-image: url('http://hdwpro.com/wp-content/uploads/2016/03/Fantastic-Full-HD-Wallpaper.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide2 {
background-image: url('http://hdwpro.com/wp-content/uploads/2016/03/Galaxy-Space-Full-HD-Wallpaper.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide3 {
background-image: url('http://hdwpro.com/wp-content/uploads/2016/03/Landscape-Full-HD-Wallpaper.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide4 {
background-image: url('http://hdwpro.com/wp-content/uploads/2018/10/Free-Desktop-Background.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide:hover {
transform: scale(1.2);
z-index:20;
}
The zoom inside the div flex seems like a minor glitch on transform scale
and i also want to find a way to just zoom the background image inside the div and not the div (that will be scaled outside of the view-port).
I tried adding a parent wrapper but it scales the div and not the background image .
As you can see in this Codepen :
https://codepen.io/pufosme/pen/MZWWpM
Thank you !
You can try like below. I wrapped the slides with a parent container and added overflow: hidden.
* {
box-sizing: border-box;
}
.wrapper {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: stretch;
justify-content: center;
}
.parent {
flex: 1;
height: 100vh;
overflow: hidden;
}
.slide {
position: relative;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
width: 100%;
height: 100%;
transition: all 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
webkit-transition: all 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.slide1 {
background-image: url('http://hdwpro.com/wp-content/uploads/2016/03/Fantastic-Full-HD-Wallpaper.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide2 {
background-image: url('http://hdwpro.com/wp-content/uploads/2016/03/Galaxy-Space-Full-HD-Wallpaper.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide3 {
background-image: url('http://hdwpro.com/wp-content/uploads/2016/03/Landscape-Full-HD-Wallpaper.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide4 {
background-image: url('http://hdwpro.com/wp-content/uploads/2018/10/Free-Desktop-Background.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.slide:hover {
transform: scale(1.2);
}
<div class="wrapper">
<div class="parent">
<div class="slide slide1"></div>
</div>
<div class="parent">
<div class="slide slide2"></div>
</div>
<div class="parent">
<div class="slide slide3"></div>
</div>
<div class="parent">
<div class="slide slide4"></div>
</div>
</div>
Personally, I would use an IMG inside each slide (using object-fit and object-position to replace the background properties). Then scale the image and not the slide and, on each slide, you set overflow: hidden.
Like this https://codepen.io/anon/pen/bOGNoN
.slide {
...
width: 100%;
height: 100vh;
overflow: hidden;
}
.slide img {
object-fit: cover;
object-position: center;
width: 100%;
height: 100%;
transition: all 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
webkit-transition: all 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.slide:hover img {
transform: scale(1.2);
z-index:20;
-webkit-box-shadow: 0px 0px 10px 0px rg-webkit-box-shadow: 0px 0px 18px 1px rgba(0,0,0,0.5);
-moz-box-shadow: 0px 0px 18px 1px rgba(0,0,0,0.5);
box-shadow: 0px 0px 18px 1px rgba(0,0,0,0.5);
}
and the HTML
<div class="slide slide1">
<img src='http://hdwpro.com/wp-content/uploads/2016/03/Fantastic-Full-HD-Wallpaper.jpg' />
</div>
I am trying to remove the text-decoration of a flex child when the parent is the anchor. I've tried all of the following code, and it is not working at all. I've created a jsFiddle, and on that the underline shows all the time and not on hover. In my WordPress installation, it only shows on hover. I'm really not sure what to do! Any help is appreciated!
Thank you ahead of time!!!!
.fleximagebox_link:hover, a.fleximagebox_link:hover, a .fleximagebox_link:hover,
.fleximagebox_link a:hover, .fleximagebox_link:hover a,
a .fleximagebox_link p:hover, .image_background:hover, .image_background:hover a,
a .image_background:hover, .image_background.fleximagebox_link a:hover,
a .image_background.fleximagebox_link:hover {
text-decoration: none!important;
}
Here is the jsFiddle that explains what I'm talking about: https://jsfiddle.net/Clare12345/th60mde3/2/
This will get rid of the underline in your fiddle .flexbox_images a { text-decoration: none; }
As to why it's on your website, all we can do is guess if you don't include the code or a link to your site. But you might try changing that line to .flexbox_images a, .flexbox_images a:hover { text-decoration: none !important; }
.flexbox_images a {
text-decoration: none;
}
.main_box {
background: white;
height: 400px;
width: 100%;
margin: 0 auto;
padding: 0px;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
overflow: hidden;
}
.main_box .flexbox_images {
color: white;
width: 100%;
padding: 0px;
overflow: auto;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flexbox_images a {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.image_background {
height: 250px;
margin: 0 auto;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
max-width: 101%;
}
.image_background_left {
background-repeat: no-repeat;
background-size: contain;
background-image: url(http://pipsum.com/350x240.jpg);
justify-content: flex-end;
margin-right: -1px;
}
.image_background_right {
background-repeat: no-repeat;
background-size: contain;
background-image: url(http://pipsum.com/350x240.jpg);
justify-content: flex-start;
margin-left: -1px;
}
.fleximagebox_link {
font-size: 28pt;
background: rgba(255, 255, 255, 0.85);
color: #000!important;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 1.5px;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
width: 130px;
}
.image_background_left .fleximagebox_link {
justify-content: flex-end;
padding-left: 35px;
}
.image_background_right .fleximagebox_link {
justify-content: flex-start;
padding-right: 35px;
}
.image_background_right .fleximagebox_link p {
font-size: 28pt!important;
color: #000!important;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 1.5px;
margin-bottom: 0px;
}
.main_black_bar {
width: 3px;
background: #000;
height: 50px;
margin-top: 15px;
margin-bottom: 15px;
margin-left: -1px;
}
.image_background_left .main_black_bar {
margin-left: 35px;
}
.image_background_right .main_black_bar {
margin-right: 35px;
}
<div class="main_box">
<div class="flexbox_images">
<a href="">
<div class="image_background image_background_left">
<div class="fleximagebox_link">Buy
<div class="main_black_bar"> </div>
</div>
</div>
</a>
<a href="">
<div class="image_background image_background_right">
<div class="fleximagebox_link">
<div class="main_black_bar"> </div>Sell</div>
</div>
</a>
</div>
</div>