CSS floating left weird behavior - html

i have an issue with floating div's in responsive template. You can see empty spaces on images below. And it happens not at every page, at some pages blocks fill all space properly.
Here is the code of a simple block:
<div class="movie-item ignore-select short-movie">
<div class="movie-img img-box">
<img src="/templates/movie-groovie/dleimages/no_image.jpg" alt="text" />
<i class="fa fa-info show-desc"></i>
<div class="movie-img-inner">
<i class="fa fa-play-circle-o go-watch pseudo-link" data-link="#"></i>
</div>
<div class="movie-series">Поле зеленое</div>
<span>доп поле</span>
</div>
<a class="movie-title" href="#">TITLE</a>
<div class="movie-tags nowrap">Some text</div>
<div class="movie-desc">
<div class="movie-date">2 март 2017</div>
<div class="movie-director"><b>Доп поле название:</b> доп поле Джеймс Кэмерон</div>
<div class="movie-text">Some text</div>
<div class="movie-rate"><i class="fa fa-thumbs-o-up"></i><span id="ratig-layer-5846" class="ignore-select"><span class="ratingtypeplus ignore-select" >0</span></span></div>
</div>
</div>
and it's styles:
.short-movie {
float: left;
width: 18%;
margin: 0 1% 20px 1%;
}
styles.css:146
.movie-item {
position: relative;
z-index: 50;
margin: 0 10px;
max-width: 200px;
}
.movie-img {
height: 210px;
z-index: 50;
border: 4px solid #fff;
box-shadow: 0 0 0 1px #e3e3e3;
border-radius: 2px;
}
styles.css:6
.img-box {
overflow: hidden;
position: relative;
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
styles.css:155
.show-desc {
position: absolute;
right: 0;
top: 0;
z-index: 150;
font-size: 18px !important;
cursor: pointer;
border-radius: 0 0 0 3px;
background-color: #fff;
color: #487a1b;
width: 30px;
height: 30px;
line-height: 30px !important;
text-align: center;
}
.movie-img-inner {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 100;
border: 5px solid #97ce68;
opacity: 0;
background-color: rgba(0,0,0,0.6);
}
.movie-series {
position: absolute;
left: 0;
bottom: 0;
z-index: 50;
width: 100%;
background-color: rgba(151, 206, 104, 0.8);
color: #487a1b;
padding: 10px;
font-weight: 700;
text-align: center;
}
.movie-title {
display: block;
margin: 10px 0 3px 0;
height: 36px;
overflow: hidden;
color: #333;
}
.movie-desc {
position: absolute;
left: 100%;
top: 0;
z-index: 150;
width: 400px;
padding: 20px;
background-color: #FFF;
display: none;
box-shadow: 0 0 15px 0 rgba(0,0,0,0.3);
min-height: 80px;
border-radius: 4px;
}
I can't find what causes the problem. Tried it on OS X Chrome and Safari. Does anybody know what can it be?

Just set:
.short-movie {
height: 275px;
}
To make all movie items be of the same height and stop them being affected by the previous elements height.

Set standard height for this div, For Example
.img-box
{
height:300px;
}

Related

Resize CSS property has no effect

I'm working on Bookmarklet. After removing not-important parts, I have bottom docking draggable window and I want to add resizing. I will probably do this by hand (using mouse down/move/up), but I want to know why resize: both property doesn't work.
I have code like this:
<div class="shell-wrapper docking">
<div class="shell-container">
<nav>
<span class="shell-dock"></span>
<span class="shell-destroy">[x]</span>
</nav>
</div>
<div class="shell-mask"></div>
</div>
.shell-wrapper nav {
cursor: row-resize;
color: #ccc;
border-bottom: 1px solid #ccc;
font-family: monospace;
text-align: right;
background: black;
font-size: 13px;
line-height: initial;
margin: 0;
width: 100%;
height: auto;
display: block;
}
.shell-container {
position: fixed;
background: black;
z-index: 99999;
bottom: 0;
left: 0;
right: 0;
height: 150px;
}
.shell-wrapper .shell-destroy {
padding: 5px;
cursor: pointer;
display: inline-block;
}
.shell-wrapper .shell-mask{
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: none;
z-index: 100
}
.shell-wrapper.drag .shell-mask {
display: block;
}
.shell-wrapper .shell-dock,
.shell-wrapper .shell-destroy {
padding: 5px 3px;
cursor: pointer;
display: inline-block;
}
.shell-wrapper.docking nav {
cursor: default;
}
.shell-wrapper .shell-dock::before {
content: "[■]";
}
.shell-wrapper.docking .shell-dock::before {
content: "[_]";
}
.shell-wrapper.docking .shell-container {
bottom: auto;
right: auto;
top: calc(var(--top, 0) * 1px);
left: calc(var(--left, 0) * 1px);
width: calc(var(--width, 500) * 1px);
height: calc(var(--height, 400) * 1px);
box-shadow: 1px 1px 10px 2px rgb(0 0 0 / 30%);
resize: both; /* this have no effect */
}
You can check the Demo on CodePen.
The code uses jQuery but the question is not related. The problem is in CSS.

Cookie bar not closing?

I would like to know if anyone can help me with my cookie bar.
It's a simple bar fixed at the bottom of the screen with a cross button.
Unfortunately, I think something is wrong or missing.
When I click the close button, nothing happens.
Maybe I am missing something in the javascript code.
Can you help me?
Thank you very much
$(".close").click(function() {
$(".cookie-banner").fadeOut();
});
.CNOcookies {
padding: 10px 0;
position: fixed;
bottom: 0;
background-color: #ffffff;
text-align: center;
z-index: 99999;
width: 100%;
max-width: 100%!important;
display: block;
margin: 0;
-webkit-box-shadow: 0px -2px 4px 0px rgb(0 0 0 / 10%);
}
.CNOctxt {
margin-left: 8.33333333%;
width: 83.33333333%;
float: left;
position: relative;
min-height: 1px;
}
.CNOcbutton {
width: 8.33333333%;
float: left;
position: relative;
min-height: 1px;
}
button.close {
padding: 0;
cursor: pointer;
border: 0;
-webkit-appearance: none;
}
.close {
font-size: 21px;
font-weight: 700;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: .5;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: 1;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="CNOcookies">
<div class="CNOctxt">
<span>Website uses cookies to improve the navigation of its users. By continuing your navigation, you accept our cookie policy. More info</span>
</div>
<div class="CNOcbutton">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true" style="background-color: white !important;">
×
</button>
</div>
</div>
It looks like this at the moment.
Reference Image
you should replace
$(".cookie-banner").fadeOut();
with
$(".CNOcookies").fadeOut();
EDIT:
I tried the script and it's working, did you delete the cache from your browser and imported correctly jQuery?
$(".close").click(function() {
$(".CNOcookies").fadeOut();
})
.CNOcookies {
padding: 10px 0;
position: fixed;
bottom: 0;
background-color: #ffffff;
text-align: center;
z-index: 99999;
width: 100%;
max-width: 100%!important;
display: block;
margin: 0;
-webkit-box-shadow: 0px -2px 4px 0px rgb(0 0 0 / 10%);
}
.CNOctxt {
margin-left: 8.33333333%;
width: 83.33333333%;
float: left;
position: relative;
min-height: 1px;
}
.CNOcbutton {
width: 8.33333333%;
float: left;
position: relative;
min-height: 1px;
}
button.close {
padding: 0;
cursor: pointer;
border: 0;
-webkit-appearance: none;
}
.close {
font-size: 21px;
font-weight: 700;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: .5;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: 1;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<html>
<div class="CNOcookies">
<div class="CNOctxt">
<span>Website uses cookies to improve the navigation of its users. By continuing your navigation, you accept our cookie policy. More info</span>
</div>
<div class="CNOcbutton">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true" style="background-color: white !important;">
×
</button>
</div>
</div>
</html>

Stop the text moving down on hover

I have a text in the middle of the div block with a font size 80px. When I hover on the div block, it will change the border size from 1px to 5px with a blue color but the text will moves down.
.calendar-content {
width: 81%;
display: block;
padding: 0;
background: #fff;
float: left;
position: relative;
margin-bottom: 150px;
}
.calendarday-container {
width: 139px;
height: 139px;
float: left;
position: relative;
margin-top: -1px;
margin-left: -1px;
border: 1px solid #ccc;
}
.calendarday-add .calendarday-number {
display: inline-block;
width: 100%;
font-size: 80px;
color: #f1f1f1;
margin: 12px 0px;
text-align: center;
}
.calendarday-number:hover {
margin: 12px 2px;
}
.calendarday-container:hover {
border: 5px solid #2e7ad1;
}
.add-day-ico {
display: none;
width: 21px;
height: 21px;
margin: 22px 0px;
float: right;
}
.calendarday-container:hover .add-day-ico {
display: block;
margin: 22px 0px;
}
<div class="calendarday-container" data-day="0" data-dropable="true">
<a href="/autoresponder/create_day.php?day=0" data-action="click" class="calendarday-add">
<span class="calendarday-number">0</span>
<img src="http://www.clker.com/cliparts/u/F/K/J/M/A/add-button-md.png" sytle="height: 21px; width: 21px;" align="right" style="margin-top: 3px;" class="add-day-ico">
</a>
</div>
Jsfiddle: http://jsfiddle.net/f0k6r9nb/
I have tried to change the margin in the calendarday-container:hover .add-day-ico but it didn't help to resolve the issue.
Can you please show me an example how I can stop the text moving down on hover?
Thank you.
Changing the width of the border from 1px to 5px and recalculating the inner parts is not a practical solution. You could use an additional element, which has 5px of transparent border and change it to 5px of colored border on hover.
Another simple solution would be to use outline instead, as it doesn't add to the elements dimensions:
.calendar-content {
width: 81%;
display: block;
padding: 0;
background: #fff;
float: left;
position: relative;
margin-bottom: 150px;
}
.calendarday-container {
width: 139px;
height: 139px;
float: left;
position: relative;
margin-top: -1px;
margin-left: -1px;
border: 1px solid #ccc;
}
.calendarday-container:hover {
outline: 5px solid #2e7ad1;
}
.calendarday-add .calendarday-number {
display: inline-block;
width: 100%;
font-size: 80px;
color: #f1f1f1;
margin: 12px 0px;
text-align: center;
}
.add-day-ico {
opacity: 0;
width: 21px;
height: 21px;
position: absolute;
bottom: 0;
right: 0;
}
.calendarday-container:hover img {
opacity: 1;
}
<div class="calendarday-container" data-day="0" data-dropable="true">
<a href="/autoresponder/create_day.php?day=0" data-action="click" class="calendarday-add">
<span class="calendarday-number">0</span>
<img src="http://www.clker.com/cliparts/u/F/K/J/M/A/add-button-md.png" class="add-day-ico">
</a>
</div>
A typical approach to showing a border on hover is to have the non-hover state be transparent or a color that matches the background along with the width matching that of the border when hovered.
In this case, there's an existing 1px border. Here, I would change the gray border blue, then use an inset box-shadow to add the additional 4px of the border.
Note: I also removed some margin for .calendarday-number on hover so the number does not shift.
.calendar-content {
width: 81%;
display: block;
padding: 0;
background: #fff;
float: left;
position: relative;
margin-bottom: 150px;
}
.calendarday-container {
width: 139px;
height: 139px;
float: left;
position: relative;
margin-top: -1px;
margin-left: -1px;
border: 1px solid #ccc;
}
.calendarday-add .calendarday-number {
display: inline-block;
width: 100%;
font-size: 80px;
color: #f1f1f1;
margin: 12px 0px;
text-align: center;
}
/*
.calendarday-number:hover {
margin: 12px 2px;
}
*/
.calendarday-container:hover {
border-color: #2e7ad1;
box-shadow: inset 0 0 0 4px #2e7ad1;
}
.add-day-ico {
display: none;
width: 21px;
height: 21px;
margin: 22px 0px;
float: right;
}
.calendarday-container:hover .add-day-ico {
display: block;
margin: 22px 0px;
}
<div class="calendarday-container" data-day="0" data-dropable="true">
<a href="/autoresponder/create_day.php?day=0" data-action="click" class="calendarday-add">
<span class="calendarday-number">0</span>
<img src="http://www.clker.com/cliparts/u/F/K/J/M/A/add-button-md.png" sytle="height: 21px; width: 21px;" align="right" style="margin-top: 3px;" class="add-day-ico">
</a>
</div>
Add this:
.calendarday-container {
border: 5px solid transparent;
outline: 1px solid #ccc;
outline: none;
}
.calendarday-container:hover {
outline: none;
}
Remove this:
.calendarday-number:hover {
margin: 12px 2px;
}
You can use a pseudo element like this. I also removed lot of unnecessary css that was fighting each other
* { margin: 0; padding: 0; box-sizing: border-box; }
body { margin: 5%; }
/* Normal */
.calendarday-container {
width: 150px; height: 150px;
position: relative;
display: flex; align-items: center; justify-content: center;
}
.calendarday-container:after {
content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
border: 1px solid #ccc; z-index: -1;
}
.caldndarday-add { text-decoration: none; }
.calendarday-number { font-size: 80px; color: #ccc; }
.add-day-ico { width: 24px; height: 24px; position: absolute; bottom: -8px; right: -8px; }
/* Hover FX */
.calendarday-container:hover:after { border: 10px solid navy; }
.calendarday-container:hover .calendarday-number { color: navy; }
<div class="calendarday-container" data-day="0" data-dropable="true">
<a class="caldndarday-add" href="/autoresponder/create_day.php?day=0" data-action="click">
<span class="calendarday-number">0</span>
<img class="add-day-ico" src="http://www.clker.com/cliparts/u/F/K/J/M/A/add-button-md.png">
</a>
</div>
The text was moving down because, There was increase in border-width from 1px to 5px while hover.
You can either maintain a outline around the box using outline property, and keeping the border: 5px solid transparent to border: 5px solid #2e7ad1 while hovering.
I've created a working fiddle for you, for better understanding: Link to Jsfiddle

Flexbox creates a lot of whitespace and moves down the object it is affecting

So I am learning to use flexbox and it was working fine untill I tried to use it on a some items that wrapped. When that happened the whole block moved down by the amount of the wrapped object.Just to be clear the top part here above the cars and below the lorem ipsum is the part that has been moved.
As you can see there's a lot of whitespace there and that is not supposed to be there and it wasn't untill I used flexbox. But my goal is to make it wrap just using flexbox (so no float: left trickery). Here's my code. http://jsfiddle.net/0eccdumy
#import url(https://fonts.googleapis.com/css?family=Roboto);
* {
margin: 0;
padding: 0;
}
#media screen and (min-width: 604px) {
#menu {
height: 50px;
width: 99.8%-1px;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
position: relative;
z-index: 99;
background: linear-gradient(#CC0, #EE0);
padding: 5px 0px 5px 0px;
border: 1px solid #566;
}
body {
margin: 0px;
height: 100%;
background-color: #444;
font-family: Roboto, sans-serif;
}
#ida {
border-right: 1px solid #111;
padding: 10px;
display: block;
}
a {
color: black;
padding: 10px;
text-decoration: none;
font-size: 1.3em;
}
div.top {
height: 100%;
width: 75%;
background-color: #F1F1F1;
margin: 0px auto;
display: block;
position: relative;
border: 5px solid #1F1F1F;
}
p {
display: inline-block;
font-size: 0.7em;
margin: 1px;
color: black;
}
.desc {
display: block;
top: -31.5%;
height: 50px;
width: 100%;
position: relative;
background-color: #F5F3F3;
border-radius: 0px 0px 9px 9px;
}
.image {
height: 110%;
width: 100%;
position: relative;
border-radius: 9px;
}
.foot {
border-top: 1px solid black;
height: 20px;
width: 100%;
top: 38.5%;
position: relative;
}
#footext {
margin: auto;
position: relative;
left: 28%;
font-size: 0.8em;
color: grey;
}
#Vaerksted {
height: 110%;
width: 100%;
position: relative;
display: block;
}
.Overflow {
height: 240px;
width: 99.8%-1px;
overflow: hidden;
margin: auto;
}
.header {
border-top: 1px solid black;
border-bottom: 1px solid black;
}
h3 {
margin: 0px
}
h4 {
margin: 0px
}
.New {
width: 90%;
height: 90%;
margin: auto;
margin-top: 10px;
margin-bottom: 15px;
position: relative;
background-color: white;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .16);
box-shadow: 0 1px 1px rgba(0, 0, 0, .16);
padding: 5px;
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.carfs {
height: 250px;
width: 250px;
border: 1px solid black;
border-radius: 9px;
position: relative;
top: 20px;
left: 0px;
margin-left: 10px;
margin-bottom: 15px;
display: inline-block;
overflow: hidden;
}
.men0img {
height: 60px;
position: relative;
top: -5px;
}
.del3 {
width: 38%;
height: 318px;
float: right;
position: relative;
top: -322px;
left: -12px;
overflow: hidden;
border: 1px solid #EAEAEA;
-webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, .16);
box-shadow: 0 2px 2px rgba(0, 0, 0, .16);
}
.3delt {
height: 500px;
width: 100%;
position: relative;
}
.del1 {
width: 60%;
border: 1px solid #C6C8C8;
}
.velkommen {
font-size: 1em;
}
.aabningstider {
height: 100px;
width: 100px;
}
.googlemaps {
height: 159px;
width: 345px;
overflow: hidden;
top: 20px;
position: relative;
}
.google_maps {
top: 25px;
margin-top: auto;
position: relative;
overflow: hidden;
}
.randlogo {
height: 56px;
width: 140px;
position: relative;
top: -2px;
margin-left: auto;
margin-right: auto;
}
#Mc {
margin-bottom: auto;
height: 110%;
position: relative;
top: -20px;
}
.op {
}
}
Now for my html
<div class="op">
<div class="New">
<div class="header">
<h3>Nyeste Biler</h3>
</div>
<div class="flexit">
<div class="carfs">
<img src="Car.jpg" class="image">
<div class="desc">
<p>
- Kilometer: 147000 KM
<br> - Geartype: Automatgear
<br> - Brænsstoftype: Benzin
</p>
<p>
- Farve: Sølv metal
<br> - Antal døre: 5 Døre
<br> - Type: Stationcar
</p>
</div>
</div>
<div class="carfs">
<img src="Car1.jpg" class="image">
<div class="desc">
<p>
- Kilometer: 153000 KM
<br> - Geartype: Manuel
<br> - Brænsstoftype: Benzin
</p>
<p>
- Farve: Sort metal
<br> - Antal døre: 5 Døre
<br> - Type: Stationcar
</p>
</div>
</div>
<div class="carfs">
<img src="MC.jpg" class="image" id="Mc">
<div class="desc">
<p>
- Kilometer: 72000 KM
<br> - Hestekræfter: 96Hk
<br> - Brænsstoftype: Benzin
</p>
<p>
- Farve: Rød
<br> - Antal døre: 0 Døre
<br> - Type: Standard
</p>
</div>
</div>
<div class="carfs">
<img src="AC.jpg" class="image">
<div class="desc">
<p>
- Kilometer: 220000 KM
<br> - Geartype: Automatgear
<br> - Brænsstoftype: Benzin
</p>
<p>
- Farve: Hvid
<br> - Antal døre: 4 Døre
<br> - Type: Autocamper
</p>
</div>
</div>
</div>
</div>
</div>
Revised Answer
The problem isn't the flexbox.
The problem is that you have a div – .del3 – which is relatively positioned upward.
Because .del3 is relatively positioned, adjacent elements will respect its original place in the layout.
The large white space represents the location of del3 before you moved it up with top: -322px.
Here's your layout with top: -322px commented out:
DEMO
There are many better ways to accomplish this layout.
There's flexbox, of course.
Or you could take del3 out of the flow with absolute positioning, so adjacent boxes ignore its existence. (Make sure to set the parent – .3delt – to position: relative.)
Or you could simply apply float: left to the first div in the row:
.del1 {
width: 60%;
border: 1px solid #C6C8C8;
float: left; /* NEW */
}
.del3 {
width: 38%;
height: 318px;
/* float: right; */
/* position: relative; */
/* top: -322px; */
/* left: -12px; */
overflow: hidden;
border: 1px solid #EAEAEA;
-webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, .16);
box-shadow: 0 2px 2px rgba(0, 0, 0, .16);
}
DEMO
Original Answer
Try removing or adjusting height: 240px from:
#media screen and (min-width: 1px)
.Overflow {
height: 240px;
width: 99.8%-1px;
overflow: hidden;
margin: auto;
}
Also, the width rule has a syntax error. Try this: width: calc(98.8% - 1px);
DEMO

Vertically Align <a> text inside a div

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.