Image hover overlay is working on all other platforms that I have tested (desktop, android, etc.) but it doesn't seem to work on iPhone. Can anyone point me in the right direction, please? I'm not sure if it is to do with the z-index or whether it might need web-kits?
When you hover or click on .service it should show the overlay text. Please see below the code:
.service {
position: relative;
width: 80%;
height: 200px;
margin: 60px 10%;
box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
transition: all 0.3s;
}
.main-img-title {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 2.5em;
font-weight: 700;
color: #f8f9fa;
opacity: 1;
transition: 0.5s;
}
.img-title {
background-color: rgba(0, 0, 0, 0.7);
padding: 2px 10px;
font-size: 1.1em;
}
.img-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 0 1%;
background: rgba(0, 0, 0, 0.7);
color: #f8f9fa;
display: flex;
flex-direction: wrap;
justify-content: center;
align-items: flex-end;
text-align: center;
opacity: 0;
}
.service:hover .main-img-title .img-title {
animation-name: title-slide-up;
animation-duration: 0.3s;
animation-fill-mode: forwards;
z-index: 50;
background-color: rgba(0, 0, 0, 0);
}
.service:hover .img-overlay {
opacity: 1;
}
#service-event:hover .main-img-title .img-title {
animation-name: title-slide-up-low;
animation-duration: 0.3s;
animation-fill-mode: forwards;
}
.overlay-img-description {
font-size: 18px;
height: 70%;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
padding: 0 1%;
width: 100%;
max-height: 200px;
}
.overlay-img-description ul {
padding: 0;
}
.overlay-img-description li {
display: inline-block;
font-size: 20px;
}
.overlay-img-description li+li::before {
content: "";
display: inline-block;
vertical-align: middle;
margin: 0 13px;
width: 10px;
height: 10px;
border-radius: 50%;
background-color: currentColor;
}
.overlay-img-description p {
margin: 10px 0 0 0;
font-size: 0.9em;
}
#keyframes title-slide-up-low {
from {
transform: translateY(0)
}
to {
transform: translateY(-45px)
}
}
<div id="service-event" class="service">
<img class="bg-img" src="Images/Steel .JPG" alt="Steel" id="steel">
<div class="main-img-title">
<div class="img-title" id="steel-title">STEEL</div>
</div>
<div class="img-overlay">
<p class="overlay-img-description" id="steel-desc">Our steel crews are experienced with the construction of system scaffolding, black steel tower and truss structures. We specialise in supplying steel climbing teams with the support of steelhand ground labourers as well as plant operators who are
familiar with the requirements of truss and steel assembly.</p>
</div>
</div>
add z-index for img-title and img-overlay, define higher value for img-overlay that will fixed your issue.
The pseudo-class :hover is not supported on mobile devices.
See this question for an alternative to :hover
If you use :active selector in combination with :hover you can achieve this according to w3schools as long as the :active selector is called after the :hover selector.
.info-slide:hover, .info-slide:active{
height:300px;
}
EDIT:
Because :active doesn't work in safari, an alternative is adding an onclick="function()" to the uppermost element. function() should create the desired changes on the webpage. The downside to this solution is the mobile user has to click the element again to close it, instead of it automatically closing.
Related
I'm trying to make a website by incorporating several sliders in one : seven css sliders in a bootstrap slider.
Everything is working fine, but I have an issue :
I want the CSS slider always centered in my right page = in the Bootstrap slider (it's the burden).
BUT I want to have the buttons of the bootstrap slider (in my case, it's the white bar with the strawberry) fixed on my left container. I want them to stay sticked between the two blocs in any resolution, witch is working fine.
I have centered once the CSS slider, but it moves the buttons with and I don't want that.
Idk what I'm messing up. Thanks for your help guys.
Here's my code (I cleaned it the best I could):
/* ----------------------------------------------------------
-------------------------------------------------------------
MAIN
-------------------------------------------------------------
------------------------------------------------------------- */
.container-fluid {
padding: 0;
}
.row {
margin: 0;
height: 100vh;
position: relative;
}
/* ----------------------------------------------------------
-------------------------------------------------------------
SPLIT LEFT
-------------------------------------------------------------
------------------------------------------------------------- */
#wrapper {
height: 100vh;
}
/* ----------------------------------------------------------
-------------------------------------------------------------
KITS & DESCRIPTIONS
-------------------------------------------------------------
------------------------------------------------------------- */
.carousel-inner aside {
text-align: center;
margin-top: 16px;
font-size: 20px;
font-weight: bold;
line-height: 28px;
color: #D87489;
letter-spacing: 1px;
}
.carousel-inner .link-more {
text-align: center;
margin-top: 12px;
font-size: 16px;
opacity: .5;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.carousel-inner .link-more a {
color: #000;
}
.carousel-inner .link-more:hover {
opacity: .9;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.carousel-inner .link-more i {
font-size: 19px;
opacity: .8;
transform: rotate(-45deg);
font-weight: bold;
padding-right: 5px;
}
/* ---------------------------------------------------
SLIDER BT
---------------------------------------------------- */
.carousel-indicators li img {
position: relative;
transition: all ease .2s;
display: block;
}
.carousel-indicators li img:hover {
opacity: .9;
transition: all ease .2s;
}
.bouton-dv-fraise,
.bouton-dv-fraise i,
a.fraise-link {
color: #E7918B !important;
}
.carousel-indicators li::after,
.carousel-indicators li::before {
display: none;
}
/*
.carousel {
width: 400px;
height: 400px;
margin: auto !important;
}
*/
.carousel ul {
width: calc(178px - 65px);
height: 698px;
padding: 26px 33px;
position: absolute;
top: 0;
left: 0;
background-color: #FFF;
margin-top: 50vh;
margin-left: -57px;
transform: translateY(-50%);
list-style-type: none;
}
.carousel-item {
width: 280px!important;
}
.carousel-indicators {
display: block;
position: relative;
}
.carousel-indicators li {
height: auto;
width: 100%;
}
.carousel-indicators img {
height: 50px;
margin: 26px 0px 40px -5px;
}
.carousel-control-prev-icon,
.carousel-control-next {
display: none;
}
/* ----------------------------------------------------------
-------------------------------------------------------------
SLIDER CSS INNER
-------------------------------------------------------------
------------------------------------------------------------- */
.slider {
height: 500px;
position: relative;
overflow: hidden;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: row nowrap;
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
-webkit-box-align: end;
-webkit-align-items: flex-end;
-ms-flex-align: end;
align-items: flex-end;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.slider__nav {
width: 10px;
height: 10px;
margin: 36px 12px;
border-radius: 50%;
z-index: 10;
outline: 6px solid #D87489;
opacity: .47;
outline-offset: -6px;
box-shadow: 0 0 0 0 #333, 0 0 0 0 rgba(51, 51, 51, 0);
cursor: pointer;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.slider__nav:checked {
-webkit-animation: check 0.4s linear forwards;
animation: check 0.4s linear forwards;
opacity: 1 !important;
}
.slider__nav:checked:nth-of-type(1)~.slider__inner {
left: 0%;
}
.slider__nav:checked:nth-of-type(2)~.slider__inner {
left: -100%;
}
.slider__nav:checked:nth-of-type(3)~.slider__inner {
left: -200%;
}
.slider__nav:checked:nth-of-type(4)~.slider__inner {
left: -300%;
}
.slider__inner {
position: absolute;
top: 0;
left: 0;
width: 200%;
height: 100%;
-webkit-transition: left 0.4s;
transition: left 0.4s;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: row nowrap;
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
}
.slider__contents {
height: 100%;
padding: 2rem;
text-align: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-flow: column nowrap;
-ms-flex-flow: column nowrap;
flex-flow: column nowrap;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.slider__image {
font-size: 2.7rem;
color: #2196F3;
}
.slider__caption {
font-weight: 500;
margin: 2rem 0 1rem;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
text-transform: uppercase;
}
.slider__txt {
color: #999;
margin-bottom: 3rem;
max-width: 300px;
}
#-webkit-keyframes check {
50% {
outline-color: #333;
box-shadow: 0 0 0 12px #333, 0 0 0 36px rgba(51, 51, 51, 0.2);
}
100% {
outline-color: #333;
box-shadow: 0 0 0 0 #333, 0 0 0 0 rgba(51, 51, 51, 0);
}
}
#keyframes check {
50% {
outline-color: #333;
box-shadow: 0 0 0 12px #333, 0 0 0 36px rgba(51, 51, 51, 0.2);
}
100% {
outline-color: #333;
box-shadow: 0 0 0 0 #333, 0 0 0 0 rgba(51, 51, 51, 0);
}
}
<header>
<div>
<div>
<div>
<div data-ride="carousel" data-interval="false">
<ul>
<li data-target="#carouselExampleIndicators" data-slide-to="0"><img src="https://keeth.fr/wp-content/uploads/2018/10/icon-fraise-couleur.png" alt="" /></li>
</ul>
<div>
<div>
<div><input title="slide1" checked="checked" name="slider-fraise" type="radio" /> <input title="slide2" name="slider-fraie" type="radio" />
<div>
<div><img src="https://keeth.fr/wp-content/uploads/2018/10/pack-fraise.png" alt="" /></div>
<div><img src="https://keeth.fr/wp-content/uploads/2018/10/pack-fraise.png" alt="" /></div>
</div>
</div>
<aside>Kit de blanchiment dentaire<br />goût fraise tendresse</aside>
<div> en savoir plus</div>
</div>
</div>
Previous Next </div>
</div>
Previous Next </div>
</div>
</header>
I did my best to make it clear, I put only one slide in it :)
Feel free to ask for more informations if needed. Thanks for your support ;;
Here is the website if needed.
This might work actually. I know it's not the best answer but still :p ....
Change this
<div class="content-header">
to
<div class="content-header" style="width: 600px;">
and edit
.carousel-inner {
width: 280px;
margin: auto;
padding-top: 50px;
}
.carousel-item {
width: 280px!important;
margin: auto;
}
in your style.css.
Well I saw a bad answer, I saw some bad code so... Here is my bad solution.
Add margin 0 auto to content-header & carousel-inner.
Now to put the buttons back in their place (.carousel-indicators):
Lose the negative margin-left
Change left: 0 to left: calc(200px - 31vw);
Lose the margin top on this element as well and put margin-top on content-header.
Once again, I would not recommend this solution but your code is already so funky that maybe this is your solution
I founded an okay solution thanks to Aditya Jangid.
I set the .content-header at 58% (as with the Bootstrap class but it didin't move all my design) and I set my margin to auto for the .carousel-item.
I know my code isn't very clean, but, it's my first one with js and BT and all, I'm still learning ;) It's a kind of a crash test haha.
Thanks for your support ! You're the best.
I have a button with the text "Description" that in IE is not clickable. Well, actually the far right edge of it is clickable, but not the whole button and text content of the button. It works fine in modern browsers (Chrome, Firefox), but not in IE. I am using IE 11 for testing. What is causing this and how do I fix it?
I've tried to strip out as much as possible...
.vertical-button {
width: 1px;
height: 20px;
background: #000;
position: absolute;
right: -68px;
top: calc(50% - 10px);
display: flex;
flex-direction: column;
justify-content: center;
opacity: 0;
-webkit-transition: 0.8s;
-moz-transition: 0.8s;
-ms-transition: 0.8s;
-o-transition: 0.8s;
transition: 0.8s;
}
.vertical-button {
right: -100px;
}
.project--active .vertical-button {
opacity: 1;
}
.project__image,
.project__text {
position: relative;
width: 100%;
max-width: 408px;
margin: 20px auto;
margin-bottom: 0px;
}
.project__text {
height: 200px;
padding: 8px;
}
.project__image,
.project__text {
width: 280px;
height: 210px;
display: inline-block;
margin: 0 auto;
}
.project__text {
padding-top: 20px;
padding-left: 20px;
}
.project {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
padding: 18px;
margin: 30px auto;
width: 614px;
height: 246px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}
.project {
padding: 20px;
width: 740px;
height: 295px;
}
.l-wrapper {
position: relative;
width: 86%;
max-width: 1024px;
margin: 0 auto;
}
.l-wrapper {
width: 80%;
}
.l-clear::after,
.l-wrapper::after {
clear: both;
content: "";
display: block;
height: 0px;
visibility: hidden;
}
.l-section {
padding: 30px 0;
}
.l-section__bg {
background-color: #F2F2F2;
}
.l-container {
position: relative;
padding-bottom: 50px;
overflow: hidden;
background-color: #FFFFFF;
z-index: 99;
}
.vertical-button__btn,
.vertical-button__btn:focus,
.vertical-button__btn:active {
background: none;
border: none;
display: inline;
font: inherit;
margin: 0;
padding: 0;
outline: none;
outline-offset: 0;
position: absolute;
top: 0px;
transform-origin: left top;
transform: rotate(90deg) translateX(-32%);
float: right;
padding: 5px;
cursor: pointer;
cursor: hand;
}
.vertical-button__stroke {
width: 1000px;
height: 1px;
background: #000;
}
<div id="app">
<div data-reactroot="">
<div class="l-container">
<div class="l-section l-section__bg">
<div class="l-wrapper">
<div class="project project--active">
<div class="project__image"></div>
<div class="project__text">
<h3 class="project__heading">Title</h3>
<div class="vertical-button">
<button class="vertical-button__btn">Description</button>
<div class="vertical-button__stroke"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Edit
I have found that if I remove this piece of HTML the button becomes clickable...
<div class="project__image"></div>
But this still doesn't help me understand why it's happening or how to fix it! I cannot actually remove that div in the real project.
I don't have IE to test, but I can tell you some ideas from my experience.
1. Check if another element is overlapping your button.
Being IE, it may handle CSS differently, hence overlapping. Since removing that image class div resolves the problem, I'd guess this would be the cause of the problem.
2. Validate the HTML.
Forgetting to close tags can create very, very bizarre bugs, also difficult to find.
3. Try turning that button into an anchor <a>
There could be browsers who won't handle the click event properly.
4. Stop using IE :)
At least use Edge.
This might be a dumb question, but I have a background that has high contrasting colors and I want my <ul>'s <li>s to change color depending on what the background color is for each individual <li>. I really don't want to bloat my CSS by adding the color property to each one. Please can someone tell me if there is any way to do this.
I'm working an a CodePen project. It's a personal portfolio page. Just for reference I'll share it with you but it's not finished yet. I want the list under My Skills to be "color responsive" (if that even exists) so that the items at the bottom are easier to read.
Here is the pen.
Much appreciated!
Just using CSS, you can use mix-blend-mode to ul.
Chcek with css to ul element as mix-blend-mode: difference;
The mix-blend-mode property defines how an element’s content should blend with its background. This means that any images or text, borders or headings will be influenced by this property.
See here. Ref: Pen
var modeList = [
"normal",
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
elem = document.querySelector(".box"),
propertyName = "mix-blend-mode",
modeElem = document.querySelector(".mode-name"),
duration = 2500;
var i = 0;
var activate = setInterval(function() {
if (i == modeList.length) i = 0;
var mode = modeList[i];
elem.style.mixBlendMode = mode;
modeElem.innerText = mode;
i++;
}, duration);
#charset "UTF-8";
* {
box-sizing: border-box;
}
body, html {
margin: 0;
height: 100%;
padding: 0;
-webkit-font-smoothing: antialiased;
}
.wrapper {
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/14179/washington.jpg") no-repeat center center fixed;
background-size: cover;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: "Nocturno Display Medium 4", Georgia;
font-style: normal;
font-weight: normal;
font-stretch: normal;
height: 100%;
width: 100%;
}
.box {
justify-content: center;
align-items: center;
display: flex;
flex-direction: column;
font-size: 8vw;
border-top: 10px solid #BF0A30;
border-bottom: 10px solid #BF0A30;
line-height: 1;
background-color: #002B65;
color: white;
background-size: cover;
mix-blend-mode: hard-light;
height: 400px;
height: 50vh;
width: 100%;
text-align: center;
text-transform: uppercase;
}
.box p {
text-rendering: optimizeLegibility;
word-spacing: 5px;
margin: 0;
}
.mode-name-wrapper {
position: absolute;
bottom: 12vh;
left: 0;
right: 0;
color: #002B65;
text-align: center;
text-transform: uppercase;
font-size: 17px;
margin: 0 auto;
padding: 0;
width: 135px;
height: 135px;
border: 5px solid white;
background-color: #ddd;
border-radius: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.mode-name-wrapper:before {
content: "★";
display: block;
line-height: 1;
font-size: 20px;
margin-top: -20px;
margin-bottom: 10px;
color: #ef0d3c;
animation: spin 2.5s ease;
animation-iteration-count: infinite;
transform-origin: center center;
}
.mode-name {
position: relative;
left: 0;
right: 0;
animation: nudge 2.5s ease;
animation-iteration-count: infinite;
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#keyframes nudge {
0% {
transform: translate(0, 0);
}
80% {
transform: translate(0, 0);
}
90% {
transform: translate(-10px, 0);
}
93% {
transform: translate(12px, 0);
}
95% {
transform: translate(-8px, 0);
}
100% {
transform: translate(0, 0);
}
}
<link rel="stylesheet" href="https://fonts.typonine.com/WF-003562-001299.css" type="text/css" />
<div class="wrapper">
<div class="box">
<p>Washington D.C.</p>
</div>
<small class="mode-name-wrapper">
<span class="mode-name">hard-light</span>
</small>
</div>
Im try to center in webpage this Progress bar circle but i cant do it , how can i center , please help me to fix that issue , ,im try to put that text-center but not work for me, please look at this image you can understand that issue,
thanks
/jsfiddle
html
<div class="content-wrap">
<div>
<div class="progress-bar position text-center" data-percent="48" data-duration="1000" data-color="#6a6f77,#5fb756"><script>$(".progress-bar").loading()</script></div>
</div>
</div>
css
/* Progress Bar */
.progress-bar {
text-align: center;
height: 150px;
width: 150px;
margin-left: 55px;
margin-top: 65px;
}
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #fff;
text-align: center;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-webkit-transition: width .6s ease;
-o-transition: width .6s ease;
transition: width .6s ease;
}
.progress-bar div {
position: absolute;
height: 200px;
width: 200px;
border-radius: 50%;
}
.progress-bar div span {
position: absolute;
font-family: sans-serif;
font-size: 60px;
line-height: 175px;
height: 175px;
width: 175px;
left: 12.5px;
top: 13.5px;
text-align: center;
border-radius: 50%;
background-color: #ffffff;
color: black;
}
.progress-bar .background {
background-color: #b3cef6;
}
.progress-bar .rotate {
clip: rect(0 100px 200px 0);
background-color: #4b86db;
}
.progress-bar .left {
clip: rect(0 100px 200px 0);
opacity: 1;
background-color: #b3cef6;
}
.progress-bar .right {
clip: rect(0 100px 200px 0);
transform: rotate(180deg);
opacity: 0;
background-color: #4b86db;
}
#keyframes toggle {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/*End of Progress Bar*/
Try this: Just add style:"text-align:center" in div, below the content-wrap div
.progress-bar {
text-align: center;
height: 150px;
width: 150px;
/* margin-left: 55px;*/
margin-left: calc(100%/2 - 100px);
margin-top: 65px;
}
try this
.progress-bar{
float: none;
display: block;
margin: 0 auto;
}
If you are using multiple progress bar, then try this
.progress-bar{
float: none;
display: inline-block;
margin: 0 auto;
}
.on-parent-element{
text-align: center
}
UPDATE-
here is working fiddle - https://jsfiddle.net/thesumit67/6jz40dfa/6/
You should add proper width on progress bar element, and remove float use inline-block instead.
In your fiddle you made two mistakes.
add jQuery before progress bar plugin.
use HTTPS to load external resources. ( check in your console )
I am having trouble vertically aligning the 's text inside a div.
This is what I have. I need to center "Next" inside the blue box:
#import url(http://fonts.googleapis.com/css?family=Muli);
/*Makes the little side arrow*/
.open {
position: fixed;
width: 100px;
height: 40px;
left: 50%;
top: -1000px;
margin-left: -80px;
margin-top: -30px;
border: 1px solid #ccc;
background-color: #fff;
border-radius: 6px;
padding: 10px 30px;
color: #444;
transition: all ease-out 0.6s;
}
.open:hover {
border: 1px solid #aaa;
box-shadow: 0 0 8px #ccc inset;
transition: all ease-out 0.6s;
}
.tutorial-box {
position: fixed;
width: 400px;
height: 238px;
top: 75px;
background-color: #F3F3F3;
border-radius: 6px;
box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.4);
}
.slider-turn p, .tutorial-box h1{
margin-left: 10px;
}
.tutorial-box:before {
content: '';
position: absolute;
left: -14px;
top: 28px;
border-style: solid;
border-width: 10px 14px 10px 0;
border-color: rgba(0, 0, 0, 0) #f3f3f3 rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
}
.tutorial-box p {
width: 350px;
font-size: 16px;
color: #a8aab2;
font-weight: 400;
line-height: 28px;
float: left;
margin: 0;
}
.tutorial-box .bottom {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
width: 100%;
bottom: 0;
position: absolute;
}
.tutorial-box .bottom .btn-2 {
flex: 3;
-webkit-flex: 3;
-ms-flex: 3;
width: 100%;
height: 54px;
background-color: #373942;
border-bottom-left-radius: 6px;
display: flex;
}
.tutorial-box .bottom span {
flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
line-height: 54px;
color: #fff;
margin-left: 25px;
font-size: 18px;
}
.next {
text-decoration: none;
display: inline-block;
vertical-align: middle;
text-align: center;
flex: 1;
background-color: #6cb5f3;
border: 0;
margin: 0;
padding: 0;
text-transform: uppercase;
color: #fff;
font-weight: bold;
border-bottom-right-radius: 6px;
cursor: pointer;
transition: all .3s;
}
.next:hover {
text-decoration: none;
background-color: #6BA5D6;
transition: all .3s;
}
.next:active {
text-decoration: none;
background-color: #5F8AAF;
}
.slider-tutorial-box {
width: 350px;
margin: 0 25px;
overflow: hidden;
}
.slider-turn {
width: 10000px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- TUTORIAL -->
<div class="tutorial-box">
<h1>Welcome</h1>
<span class="close"></span>
<div class="slider-container">
<div class="slider-turn">
<p>
Here, under the Company tab, is where you will do most of the company managment.<br>
</p>
</div>
</div>
<div class="bottom">
<div class="btn-2">
<span>Step 2/?</span>
</div>
Next
</div>
</div>
Please let me know how I can center the text vertically to the center of the div.
Thank you very much. Let me know if I wasn't clear enough.
Seems like you already did that for .tutorial-box .bottom span so, do the same thing for .next
.next{
line-height: 54px;
}
the simplest and possibly most easy way would be to add the 'center' and '/center' tag before and after the text you want, and after each letter use '/br' to move to the next line. this will add some bulk, but would be considerably easier than other methods.
<center>
'letter'</br>'next letter'</br>'next letter'</br>
</center>
repeating the letter and break for all letters
alternatively, you could also add "div" tags around the "a" tag. you would have to modify the 'height' and 'width' to make it vertical for you. I would use px for this and not '%' or 'em'. add this to them:
<div style="height: /* modify this */100px; width: /* and this*/20px;">
Next
</div>
this may not be AS compatible cross platform though.
Like this:
.next {
position: relative;
top: 50%;
transform: translateY(-50%);
}
A nice trick that works both vertically and horizontally.