I have created a option button for my project. The code is given below.I am trying to make proper alignment of .dotlist is moving on right side. It should me on left portion of dot button.
What will be the solution for making perfect dot dropdown button thus the list appear properly.
$('.dottbtn').on('click', function(e) {
e.stopPropagation();
$('.dotmenu').toggleClass('dotopened');
});
$(document).on('click', function() {
$('.dotmenu').removeClass('dotopened');
});
body {
margin: 0;
background: tomato;
font-family: 'Open Sans', sans-serif;
}
.dotted {
display: inline-block;
vertical-align: top;
float: right;
}
.dottbtn {
cursor: pointer;
margin-top: 5px;
width: 40px;
height: 20px;
z-index: 80;
position: relative;
align-items: flex-end;
}
.dottbtn {
background: url('https://image.flaticon.com/icons/svg/483/483345.svg');
background-size: 17px 17px;
height: 17px;
width: 17px;
}
.dotmenu {
width: 150px;
border-radius: 10px;
margin-top: 20px;
display: inline-block;
float: right;
background: #fff;
position: absolute;
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.15);
z-index: 90;
visibility: hidden;
opacity: 0;
-webkit-transition: all 300ms ease;
transition: all 300ms ease;
}
.dotmenu.dotopened {
visibility: visible;
opacity: 1;
}
.dotmenu::before {
content: '';
position: absolute;
top: -5px;
right: 7px;
width: 15px;
height: 15px;
background: #fff;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.dotmenu ul {
list-style: none;
margin: 0;
padding: 0;
}
.dotmenu ul.dot-list {
text-align: left;
font-weight: 100;
width: 100%;
margin: auto;
padding-top: 10px;
padding-bottom: 10px;
}
.dotmenu ul.dot-list li a {
text-decoration: none;
padding-left: 20px;
padding-top: 5px;
color: #343434;
font-weight: 600;
display: block;
line-height: 27px;
-webkit-transition: all 200ms ease;
transition: all 200ms ease;
}
.dotmenu ul.dot-list li a:hover {
color: tomato;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="dotted">
<div class="dottbtn"></div>
<div class="dotmenu">
<ul class="dot-list">
<li>Home</li>
<li>Gallery</li>
<li>Contact</li>
</ul>
</div>
</div>
Please help me to overcome from it.
Add right: 15px to .dottbtn and right: 10px to .dotmenu :
$('.dottbtn').on('click', function(e) {
e.stopPropagation();
$('.dotmenu').toggleClass('dotopened');
});
$(document).on('click', function() {
$('.dotmenu').removeClass('dotopened');
});
body {
margin: 0;
background: tomato;
font-family: 'Open Sans', sans-serif;
}
.dotted {
display: inline-block;
vertical-align: top;
float: right;
}
.dottbtn {
cursor: pointer;
margin-top: 5px;
width: 40px;
height: 20px;
z-index: 80;
position: relative;
align-items: flex-end;
}
.dottbtn {
background: url('https://image.flaticon.com/icons/svg/483/483345.svg');
background-size: 17px 17px;
height: 17px;
width: 17px;
right: 15px;
}
.dotmenu {
width: 150px;
border-radius: 10px;
margin-top: 20px;
display: inline-block;
float: right;
background: #fff;
position: absolute;
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.15);
z-index: 90;
visibility: hidden;
opacity: 0;
-webkit-transition: all 300ms ease;
transition: all 300ms ease;
right: 10px;
}
.dotmenu.dotopened {
visibility: visible;
opacity: 1;
}
.dotmenu::before {
content: '';
position: absolute;
top: -5px;
right: 7px;
width: 15px;
height: 15px;
background: #fff;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.dotmenu ul {
list-style: none;
margin: 0;
padding: 0;
}
.dotmenu ul.dot-list {
text-align: left;
font-weight: 100;
width: 100%;
margin: auto;
padding-top: 10px;
padding-bottom: 10px;
}
.dotmenu ul.dot-list li a {
text-decoration: none;
padding-left: 20px;
padding-top: 5px;
color: #343434;
font-weight: 600;
display: block;
line-height: 27px;
-webkit-transition: all 200ms ease;
transition: all 200ms ease;
}
.dotmenu ul.dot-list li a:hover {
color: tomato;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="dotted">
<div class="dottbtn"></div>
<div class="dotmenu">
<ul class="dot-list">
<li>Home</li>
<li>Gallery</li>
<li>Contact</li>
</ul>
</div>
</div>
Adding right:0; to your .dotmenu will fix it.
$('.dottbtn').on('click', function(e) {
e.stopPropagation();
$('.dotmenu').toggleClass('dotopened');
});
$(document).on('click', function() {
$('.dotmenu').removeClass('dotopened');
});
body {
margin: 0;
background: tomato;
font-family: 'Open Sans', sans-serif;
}
.dotted {
display: inline-block;
vertical-align: top;
float: right;
}
.dottbtn {
cursor: pointer;
margin-top: 5px;
width: 40px;
height: 20px;
z-index: 80;
position: relative;
align-items: flex-end;
}
.dottbtn {
background: url('https://image.flaticon.com/icons/svg/483/483345.svg');
background-size: 17px 17px;
height: 17px;
width: 17px;
}
.dotmenu {
width: 150px;
border-radius: 10px;
margin-top: 20px;
display: inline-block;
float: right;
background: #fff;
position: absolute;
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.15);
z-index: 90;
visibility: hidden;
opacity: 0;
-webkit-transition: all 300ms ease;
transition: all 300ms ease;
right: 0;
}
.dotmenu.dotopened {
visibility: visible;
opacity: 1;
}
.dotmenu::before {
content: '';
position: absolute;
top: -5px;
right: 7px;
width: 15px;
height: 15px;
background: #fff;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.dotmenu ul {
list-style: none;
margin: 0;
padding: 0;
}
.dotmenu ul.dot-list {
text-align: left;
font-weight: 100;
width: 100%;
margin: auto;
padding-top: 10px;
padding-bottom: 10px;
}
.dotmenu ul.dot-list li a {
text-decoration: none;
padding-left: 20px;
padding-top: 5px;
color: #343434;
font-weight: 600;
display: block;
line-height: 27px;
-webkit-transition: all 200ms ease;
transition: all 200ms ease;
}
.dotmenu ul.dot-list li a:hover {
color: tomato;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="dotted">
<div class="dottbtn"></div>
<div class="dotmenu">
<ul class="dot-list">
<li>Home</li>
<li>Gallery</li>
<li>Contact</li>
</ul>
</div>
</div>
Related
I'm working on the animation and cannot figure out how I can stop the animation from repeating an infinite amount of times, but also still show after it has completed the animation once. An extra thing as well if you could tell me is that i have 4 different sentences to animate and it would be great if I could make the animations animate one by one then finish and still show.
p.s This is all in css and a lot of changes have been done with copy and paste of used code so i know the animation stuff is repeated
type he
#import url('https://fonts.googleapis.com/css2?family=Quicksand:wght#300&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Quicksand';
background-image: url('images/websitesbackground.jpg');
}
.header {
margin-top: -15px;
}
.logo {
font-family: 'Quicksand';
font-weight:lighter;
margin-top: -10px;
border: black 3px none;
padding: 3px 3px;
height: 100px;
width: 350px;
position: absolute;
margin-left: -20px;
margin-top: -180px;
}
.wrapper1 {
display: inline-flex;
display: flex;
align-items: left;
justify-content: left;
margin-top: 200px;
margin-left: 10%;
}
.wrapper1 .static-txt {
color: black;
font-size: 193%;
font-weight: 400;
color: #121212;
text-shadow: 2px 7px 5px rgba(0,0,0,0.3),
0px -4px 10px rgba(255,255,255,0.3);
}
.wrapper1 .dynamic-txts {
margin-left: 10px;
line-height: -10px;
overflow: hidden;
}
.dynamic-txts li {
color: black;
list-style: none;
font-size: 30px;
font-weight: 500;
position: relative;
top: 0;
animation: slide 12s steps(1);
}
#keyframes slide {
100% {
top: -160px;
}
}
.dynamic-txts li span {
position: relative;
}
.dynamic-txts li span::after {
content: "";
position: absolute;
left: 0;
height: 100%;
width: 100%;
background: url('images/websitesbackground.jpg');
border-left: 2px solid black;
animation: typing 3.2s steps(15) infinite;
}
#keyframes typing {
100% {
left: 100%;
margin: 0 -35px 0 35px;
}
}
.wrapper2 {
display: inline-flex;
display: flex;
align-items: left;
justify-content: left;
margin-top: 7%;
margin-left: 10%;
}
.wrapper2 .static-txt {
color: black;
font-size: 193%;
font-weight: 400;
color: #121212;
text-shadow: 2px 7px 5px rgba(0,0,0,0.3),
0px -4px 10px rgba(255,255,255,0.3);
}
.wrapper2 .dynamic-txts {
margin-left: 10px;
line-height: -10px;
overflow: hidden;
}
.dynamic-txts li {
color: black;
list-style: none;
font-size: 30px;
font-weight: 500;
position: relative;
top: 0;
animation: slide 12s steps(1);
}
#keyframes slide {
100% {
top: -160px;
}
}
.dynamic-txts li span {
position: relative;
}
.dynamic-txts li span::after {
content: "";
position: absolute;
left: 0;
height: 100%;
width: 100%;
background: url('images/websitesbackground.jpg');
border-left: 2px solid black;
animation: typing 3.2s steps(15) infinite;
}
#keyframes typing {
100% {
left: 100%;
margin: 0 -35px 0 35px;
}
}
.wrapper3 {
display: inline-flex;
display: flex;
align-items: left;
justify-content: left;
margin-top: 7%;
margin-left: 10%;
}
.wrapper3 .static-txt {
color: black;
font-size: 193%;
font-weight: 400;
color: #121212;
text-shadow: 2px 7px 5px rgba(0,0,0,0.3),
0px -4px 10px rgba(255,255,255,0.3);
}
.wrapper3 .dynamic-txts {
margin-left: 10px;
line-height: -10px;
overflow: hidden;
}
.dynamic-txts li {
color: black;
list-style: none;
font-size: 30px;
font-weight: 500;
position: relative;
top: 0;
animation: slide 12s steps(1);
box-shadow: 2px -2px 2px;
color: #121212;
text-shadow: 2px 7px 5px rgba(0,0,0,0.3),
0px -4px 10px rgba(255,255,255,0.3);
}
#keyframes slide {
100% {
top: -160px;
}
}
.dynamic-txts li span {
position: relative;
}
.dynamic-txts li span::after {
content: "";
position: absolute;
left: 0;
height: 100%;
width: 100%;
background: url('images/websitesbackground.jpg');
border-left: 2px solid black;
animation: typing 3.2s steps(15);
}
#keyframes typing {
100% {
left: 100%;
margin: 0 -35px 0 35px;
}
}
.wrapper4 {
display: inline-flex;
display: flex;
align-items: left;
justify-content: left;
margin-top: 7%;
margin-left: 10%;
}
.wrapper4 .static-txt {
color: black;
font-size: 193%;
font-weight: 400;
color: #121212;
text-shadow: 2px 7px 5px rgba(0,0,0,0.3),
0px -4px 10px rgba(255,255,255,0.3);
}
.wrapper4 .dynamic-txts {
margin-left: 10px;
line-height: -50px;
overflow: hidden;
}
.dynamic-txts li {
color: black;
list-style: none;
font-size: 30px;
font-weight: 500;
position: relative;
top: 0;
}
#keyframes slide {
100% {
top: -160px;
}
}
.dynamic-txts li span {
position: relative;
}
.dynamic-txts li span::after {
content: "";
position: absolute;
left: 0;
height: 100%;
width: 100%;
background: url('images/websitesbackground.jpg');
border-left: 2px solid black;
}
#keyframes typing {
100% {
left: 100%;
margin: 0 -35px 0 35px;
}
}
#keyframes bubble {
0% { transform:scale(0.5); opacity:0.0; left:0}
50% { transform:scale(1.2); opacity:0.5; left:100px}
100% { transform:scale(1.0); opacity:1.0; left:200px}
}
.img {
border-radius: 1000px;
margin-left: 59%;
margin-top: -44.3%;
height: 600px;
}
.dynamic-txts {
visibility: visible;
}
re
I have tried all the things i could think of (but its still probably going to be obvious) and i just cant think of anything else, hope someone could help.
I'm new in css and I have pure hamburguer css menu
Problem is the menu is part of page as absolute item, I want it to float and show always when page scroll, the position is just bellow header
Desire result:
And when menu is open take space of page and show an icon at the bottom of menu:
Snippet:
*{
box-sizing: border-box;
}
body{
font-family: 'Montserrat', sans-serif;
margin:0px;
}
.section-title{
color: #2ddf5c;
}
.main-header{
display: flex;
align-items: center;
justify-content: space-evenly;
width:100%;
/* background: #2ddf5c; */
padding: 16px;
}
.main-header > div{
vertical-align: middle;
}
.main-header__brand{
color: #7B8F34;
text-decoration: none;
font-weight: bold;
font-size: 20px;
}
.main-nav__searchbar_container {
display: flex;
width: 100%;
padding: 8px 8px 8px 40px;
overflow: hidden;
vertical-align: middle;
white-space: nowrap;
}
.main-nav__searchbar_container input.main-nav__searchbar{
width:100%;
height: 50px;
/* background: #2b303b; */
border: none;
font-size: 10pt;
float: left;
/* color: #fff; */
padding-left: 15px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.main-nav__searchbar_container input.main-nav__searchbar::-webkit-input-placeholder{
color: #65737e;
}
.main-nav__searchbar_container input.main-nav__searchbar:-moz-placeholder{ /*Frefox 18 */
color: #65737e;
}
.main-nav__searchbar_container input.main-nav__searchbar::-moz-placeholder{/*Frefox 19 */
color: #65737e;
}
.main-nav__searchbar_container input.main-nav__searchbar:-ms-input-placeholder{
color: #65737e;
}
.main-nav__searchbar_container button.icon{
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border: none;
background: #4f5b66;
height: 50px;
width: 50px;
color: #ffffff;
opacity: 0;
font-size: 10pt;
-webkit-transition: all .55s ease;
-moz-transition: all .55s ease;
-ms-transition: all .55s ease;
-o-transition: all .55s ease;
transition: all .55s ease;
}
.main-nav__searchbar_container:hover button.icon,
.main-nav__searchbar_container:active button.icon,
.main-nav__searchbar_container:focus button.icon{
outline: none;
opacity: 1;
margin-left: -50px;
}
.main-nav__searchbar_container:hover button.icon:hover{
background: red;
cursor: pointer;
}
input.main-nav__searchbar:hover{
border: 2px solid #4f5b66;
}
.main-nav__searchbar{
display: flex;
width: 100%;
/* margin: 8px; */
/* padding: 8px; */
border: 2px solid;
border-radius: 4px;
outline: none;
transition: .3s;
}
.main-nav{
display: flex;
width: 100%;
text-align: right;
margin: 0 10px;
}
.main-nav__items{
display: flex;
margin:8px;
padding:8px;
list-style: none;
}
.main-nav__item{
display: inline-block;
}
.main-nav__social{
display:block;
width: 35px;
height: 35px;
margin-left: 10px;
padding: 4px;
}
#main-slider {
width: 100%;
height: 528px;
/* border-radius: 0% 0% 50% 50% / 0% 0% 20% 20%; */
border-bottom-right-radius: 50% 25%;
border-bottom-left-radius: 50% 25%;
position: relative;
}
.badge {
background-color: #fff;
border-radius: 30px;
box-shadow: 0 15px 35px 0 rgba(42,51,83,.12), 0 5px 15px rgba(0,0,0,.06);
position: absolute;
margin-top: 0.5em;
}
.text {
padding: 0.5rem 0.25rem 0.5rem 1rem;
}
.link {
border-radius: inherit;
display: inline-block;
background-color: #7B8F34;
padding: 0.5rem 1rem;
color: #F9F9EC;
}
.slider-wrapper {
display: flex;
justify-content: center;
align-items: flex-end;
}
/* menu */
.main .menu {
clear: both;
/* max-height: 0; */
display: none;
transition: max-height .2s ease-out;
}
/* menu icon */
.main .menu-icon {
cursor: pointer;
float: right;
padding: 28px 20px;
position: relative;
user-select: none;
}
.main .menu-icon .nav-icon {
background: #333;
display: block;
height: 2px;
position: relative;
transition: background .2s ease-out;
width: 18px;
}
.main .menu-icon .nav-icon:before,
.main .menu-icon .nav-icon:after {
background: #333;
content: '';
display: block;
height: 100%;
position: absolute;
transition: all .2s ease-out;
width: 100%;
}
.main .menu-icon .nav-icon:before {
top: 5px;
}
.main .menu-icon .nav-icon:after {
top: -5px;
}
/* menu btn */
.main .menu-btn {
display: none;
}
.main .menu-btn:checked ~ .menu {
/* max-height: 240px; */
display: block;
}
.main .menu-btn:checked ~ .menu-icon .nav-icon {
background: transparent;
}
.main .menu-btn:checked ~ .menu-icon .nav-icon:before {
transform: rotate(-45deg);
top:0;
}
.main .menu-btn:checked ~ .menu-icon .nav-icon:after {
transform: rotate(45deg);
top:0;
}
#media (min-width: 48em) {
.main li a {
padding: 20px 30px;
}
.main .menu {
clear: none;
float: right;
max-height: none;
}
}
<header class="main-header">
<div>
<a href="index.html" class="main-header__brand">
uHost
</a></div><nav class="main-nav">
<div class=main-nav__searchbar_container><input type="text" placeholder="Search" class="main-nav__searchbar">
<button class="icon"><i class="fas fa-search" aria-hidden="true"></i></button>
</div>
<ul class="main-nav__items">
<li class="main-nav__item">
<img class="main-nav__social" src="navbar-icons/social-media__icons/facebook.svg" alt="facebook">
</li>
<li class="main-nav__item">
<img class="main-nav__social" src="navbar-icons/social-media__icons/instagram-bosquejado.svg" alt="instagram">
</li>
</ul>
</nav>
</header>
<div class="main">
<input class="menu-btn" type="checkbox" id="menu-btn" />
<label class="menu-icon" for="menu-btn"><span class="nav-icon"></span></label>
<ul class="menu">
<li>Test1</li>
<li>Test2</li>
<li>Test3</li>
</ul>
</div>
<main>
<section>
<div class="slider-wrapper">
<img id="main-slider" src="https://via.placeholder.com/1365x528?text=Slider">
</div>
</section>
Regards
I'm new to React and cant figure out why my App look different on Chrome and Edge Browser. It show stripes in between images and try to remove them.
The strange thing is when I debug in VCode it looks fine and debug browser is Chrome
This is the App web site under construction
This is Edge Browser and image does not show the stripes in between images:
This is Chrome and stripes is there:
And here is the css:
At row 75 I removed the stripe background color like this:
/* background-color: #1d1d1e; this is background that show in between slides*/
html {
scroll-behavior: smooth;
}
.is-180x180 {
height: 180px;
width: 180px;
}
.skill-list > li {
margin: 30px 0 0 0;
}
.has-bg-image {
background-image: url("../images/GretaThunberg collage2.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.bulma-image {
width: 200px;
}
.interests {
display: flex;
justify-content: center;
}
.summary-text {
margin-left: auto;
margin-right: auto;
max-width: 36em;
}
.skill-percentage {
float: right;
}
/* For the under construction text on images */
div {
white-space: pre-wrap;
}
/* //General */
body {
margin: 0;
background-color: #1d1d1e;
font-family: "Roboto", sans-serif;
}
* {
outline: none;
}
/* //Timeline carousel for weeks */
body {
margin: 0;
background-color: #1d1d1e;
font-family: "Roboto", sans-serif;
}
* {
outline: none;
}
.timeline-carousel {
padding: 86px 6.9444% 90px 6.9444%;
position: relative;
overflow: hidden;
}
.timeline-carousel:after,
.timeline-carousel:before {
content: "";
position: absolute;
display: block;
top: 0;
height: 100%;
width: 6.9444%;
/* background-color: #1d1d1e; this is background that show in between slides*/
z-index: 3;
}
.timeline-carousel:after {
left: 0;
}
.timeline-carousel:before {
right: 0;
opacity: 0;
}
.timeline-carousel .slick-list {
overflow: visible;
}
.timeline-carousel .slick-dots {
bottom: -73px;
}
.timeline-carousel h1 {
color: white;
font-size: 46px;
line-height: 50px;
margin-bottom: 40px;
font-weight: 900;
}
.timeline-carousel__image {
padding-right: 30px;
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 164px;
}
.timeline-carousel__item {
cursor: pointer;
}
.timeline-carousel__item .media-wrapper {
opacity: 0.4;
padding-bottom: 71.4%;
-webkit-transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
-o-transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}
.timeline-carousel__item:last-child .timeline-carousel__item-inner:after {
width: calc(100% - 30px);
}
.timeline-carousel__item-inner {
position: relative;
padding-top: 45px;
}
.timeline-carousel__item-inner:after {
position: absolute;
width: 100%;
top: 45px;
left: 0;
content: "";
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.timeline-carousel__item-inner .year {
font-size: 36px;
line-height: 36px;
color: white;
display: table;
letter-spacing: -1px;
padding-right: 10px;
background-color: #1d1d1e;
z-index: 1;
position: relative;
margin: -15px 0 20px;
font-weight: 900;
}
.timeline-carousel__item-inner .year:after {
content: "";
position: absolute;
display: block;
left: -10px;
top: 0;
height: 100%;
width: 10px;
background-color: #1d1d1e;
z-index: 3;
}
.timeline-carousel__item-inner .month {
font-size: 12px;
text-transform: uppercase;
color: #b38c52;
display: block;
margin-bottom: 10px;
font-weight: 900;
}
.timeline-carousel__item-inner p {
font-size: 12px;
line-height: 18px;
color: white;
width: 60%;
font-weight: 400;
margin-bottom: 15px;
}
.timeline-carousel__item-inner .read-more {
font-size: 12px;
color: #b38c52;
display: table;
margin-bottom: 10px;
font-weight: 900;
text-decoration: none;
position: relative;
}
.timeline-carousel__item-inner .read-more:after {
content: "";
position: absolute;
left: 0;
bottom: -1px;
width: 0;
border-bottom: 2px solid #b38c52;
-webkit-transition: all 0.2s cubic-bezier(0.55, 0.085, 0.68, 0.53);
-o-transition: all 0.2s cubic-bezier(0.55, 0.085, 0.68, 0.53);
transition: all 0.2s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}
.timeline-carousel__item-inner .read-more:hover:after {
width: 100%;
}
.timeline-carousel__item-inner .pointer {
height: 29px;
position: relative;
z-index: 1;
margin: -4px 0 16px;
}
.timeline-carousel__item-inner .pointer:after,
.timeline-carousel__item-inner .pointer:before {
position: absolute;
content: "";
}
.timeline-carousel__item-inner .pointer:after {
width: 9px;
height: 9px;
border-radius: 100%;
top: 0;
left: 0;
background-color: #b38c52;
}
.timeline-carousel__item-inner .pointer:before {
width: 1px;
height: 100%;
top: 0;
left: 4px;
background-color: #b38c52;
}
.timeline-carousel .slick-active .media-wrapper {
opacity: 1 !important;
}
.slick-dots {
bottom: 60px;
list-style: none;
position: absolute;
width: 100%;
left: 0;
text-align: center;
z-index: 2;
}
.slick-dots li {
cursor: pointer;
display: inline-block;
margin: 0 6px;
position: relative;
width: 10px;
height: 10px;
}
.slick-dots li:last-child {
margin-right: 0;
}
.slick-dots li.slick-active button {
background: #b38c52;
border-color: #b38c52;
}
.slick-dots li button {
display: block;
font-size: 0;
width: 10px;
height: 10px;
padding: 0;
background-color: rgba(255, 255, 255, 0.6);
border-color: rgba(255, 255, 255, 0.6);
cursor: pointer;
-webkit-transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
-o-transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}
.slick-dots li button:hover {
background: #b38c52;
border-color: #b38c52;
}
.link {
position: absolute;
left: 0;
bottom: 0;
padding: 20px;
z-index: 9999;
}
.link a {
display: flex;
align-items: center;
text-decoration: none;
color: #fff;
}
.link .fa {
font-size: 28px;
margin-right: 8px;
color: #fff;
}
I'm having issues getting this button to stay in the button holder which floats above my site content. How would I add a drop down menu and this keep it in the same button holder.
.btn-holder {
background: rgba(255, 255, 255, 0.5);
position: static;
z-index: 10;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
.button {
transform: translate(-50%, -50%);
background-color: #a137a7;
border: none;
color: white;
padding: 8px 13px;
text-align: center;
text-decoration: none;
font-size: 16px;
position: absolute;
cursor: pointer;
right: -1%;
bottom: -1%;
font-family:'Source Sans Pro', sans-serif;
opacity: .8; }
.button:hover {
background-color: #732878; /* Green */
color: white;
}
<div class="btn-holder">
<div class="button"><a href="/"><img class="img-responsive2"
src="http://static.tumblr.com/e2rgcy1/e6Yod1iwo/pop-out-icon.png"></a></div>
</div>
<!-- begin snippet: js hide: false console: true babel: false -->
Here's a quick example that should help get you started in the right direction! A few improvements could be made (such as delaying the display:none so that you can actually click links in the menu), but you should be able to figure that out. If not just let me know in the comments and I'll improve it.
#btn-holder {
background: rgba(255, 255, 255, 0.5);
position: static;
z-index: 10;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
#btn-holder > .button {
transform: translate(-50%, -50%);
background-color: #a137a7;
border: none;
color: white;
padding: 8px 13px;
text-align: center;
text-decoration: none;
font-size: 16px;
position: absolute;
cursor: pointer;
right: -1%;
bottom: -1%;
font-family: 'Source Sans Pro', sans-serif;
opacity: .8;
border-radius: 3px;
}
#btn-holder > .button:hover {
background-color: #732878;
color: white;
}
#btn-holder > .menu {
opacity: 0;
transition: opacity .5s;
width: 100px;
transform: translate(-50%, -50%);
background-color: #333;
border: none;
color: white;
padding: 8px;
text-align: left;
text-decoration: none;
font-size: 16px;
position: absolute;
right: 0%;
bottom: 25px;
box-shadow:0 2px 7px rgba(0,0,0,.4);
}
.menu a {
text-decoration: none;
color: #eee;
transition: color .3s;
}
.menu a:hover {
color: #2196f3;
}
.menu > ul {
list-style: none;
margin: 2px;
padding: 0 0 0 15px;
}
.menu > ul > li:first-child {
margin-left: -15px;
}
.menu p {
opacity: 1;
margin: 0;
}
.menu p:after {
content:"";
display: block;
height: 1px;
vertical-align: bottom;
width: 100%;
border-top: 1px solid #eee;
opacity: .4;
}
#btn-holder > .button:hover + .menu {
opacity: 1;
transistion-delay: 1s;
}
#btn-holder .menu:hover {
opacity: 1;
}
<div id="btn-holder">
<div class="button">
<img class="img-responsive2" src="https://static.tumblr.com/e2rgcy1/e6Yod1iwo/pop-out-icon.png">
</div>
<div class="menu">
<p>Home</p>
<ul>
<li>Blog</li>
<li>Post 1</li>
<li>Post 2</li>
</ul>
<p>Products</p>
<p>About</p>
</div>
</div>
Here's a codepen of it that you can use to try your own changes on: http://codepen.io/XanderLuciano/pen/YGPoqE
I used the CSS + selector to select the div class="menu" that occurs right after the div class="button" and changed it's display from none to block when .button:hover is active. The code looks like this:
#btn-holder > .button:hover + .menu {
display: block;
}
Let me know if you have any questions! :)
#btn-holder {
background: rgba(255, 255, 255, 0.5);
position: static;
z-index: 10;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
#btn-holder > .button {
transform: translate(-50%, -50%);
background-color: #a137a7;
border: none;
color: white;
padding: 8px 13px;
text-align: center;
text-decoration: none;
font-size: 16px;
position: absolute;
cursor: pointer;
right: -1%;
bottom: -1%;
font-family: 'Source Sans Pro', sans-serif;
opacity: .8;
border-radius: 3px;
}
#btn-holder > .button:hover {
background-color: #732878;
color: white;
}
#btn-holder > .menu {
opacity: 0;
transition: opacity .5s;
width: 100px;
transform: translate(-50%, -50%);
background-color: #333;
border: none;
color: white;
padding: 8px;
text-align: left;
text-decoration: none;
font-size: 16px;
position: absolute;
right: 0%;
bottom: 25px;
box-shadow:0 2px 7px rgba(0,0,0,.4);
}
.menu a {
text-decoration: none;
color: #eee;
transition: color .3s;
}
.menu a:hover {
color: #2196f3;
}
.menu > ul {
list-style: none;
margin: 2px;
padding: 0 0 0 15px;
}
.menu > ul > li:first-child {
margin-left: -15px;
}
.menu p {
opacity: 1;
margin: 0;
}
.menu p:after {
content:"";
display: block;
height: 1px;
vertical-align: bottom;
width: 100%;
border-top: 1px solid #eee;
opacity: .4;
}
#btn-holder > .button:hover + .menu {
opacity: 1;
transistion-delay: 1s;
}
#btn-holder .menu:hover {
opacity: 1;
}
<div id="btn-holder">
<div class="button">
<img class="img-responsive2" src="https://static.tumblr.com/e2rgcy1/e6Yod1iwo/pop-out-icon.png">
</div>
<div class="menu">
<p>Home</p>
<ul>
<li>Blog</li>
<li>Post 1</li>
<li>Post 2</li>
</ul>
<p>Products</p>
<p>About</p>
</div>
</div>
I have about 6 divs that I set to position: absolute.
After reading other threads, I made sure the parent element was set to position: relative,
Still for some reason the vertical positioning of these elements differ depending on browser/device.
For example, the positioning looks okay on chrome for macbook.
But it is off on Safari for Macbook, Safari on iPad as well as Chrome and IE for Windows.
http://codepen.io/donnaloia/pen/WbYbLa
It is the suggestion divs (in light gray), that are not positioning correctly.
What am I doing wrong here? Why is this happening?
.backgroundiv {
background-image: url(/static/img/bg-hero.jpg);
width: 100%;
position: relative;
padding-top: 25px;
height: 986px;
}
.background2div {
background-color: black;
background-repeat: repeat;
height: 800px;
position: relative;
}
.linecontainer {
width: 486px;
display: inline-block;
margin-left: 68px;
}
.formdiv {
padding-top: 50px;
float: center;
background-color: white;
height: 845px;
margin: 0 auto;
border-radius: 3px;
width: 632px;
position: relative;
}
.selltitle {
font-family: futura;
font-size: 28px;
text-align: center;
padding-bottom: 50px;
}
.forminput {
float:right;
margin-bottom: 32px;
}
.forminput input {
padding-top: .5em;
padding-bottom: .5em;
width: 230px;
}
.forminput submit {
padding-top: .5em;
}
.forminput2 {
float:right;
width: 232px;
margin-bottom: 32px;
}
textarea {
padding: .5em;
width: 221px;
border: 1px solid rgba(0, 0, 0, 0.2);
}
.checkmark1{
top: 228px;
display:none;
height: 10px;
position: absolute;
width: 20px;
left: 894px;
}
.checkmarkimg {
width:20px;
}
.checkmark2{
top:285px;
display:none;
height: 10px;
position: absolute;
width: 20px;
left: 894px;
}
.checkmark3{
top:462px;
display:none;
height: 10px;
position: absolute;
width: 20px;
left: 894px;
}
.checkmark4{
top:545px;
display:none;
height: 10px;
position: absolute;
width: 20px;
left: 894px;
}
.checkmark5{
top:603px;
display:none;
height: 10px;
position: absolute;
width: 20px;
left: 894px;
}
input.parsley-success,
select.parsley-success,
textarea.parsley-success {
color: #468847;
background-color: #DFF0D8;
border: 1px solid #D6E9C6;
}
input.parsley-error,
select.parsley-error,
textarea.parsley-error {
color: #B94A48;
background-color: #F2DEDE;
border: 1px solid #EED3D7;
}
.inputholder.parsley-success.checkmarksuccess {
display: block;
width:26px;
height:24px;
position:absolute;
}
.parsley-errors-list {
margin: 2px 0 3px 0;
padding: 0;
list-style-type: none;
font-size: 0.9em;
line-height: 0.9em;
opacity: 0;
position: absolute;
padding-top: 6px;
font-size:14px;
-moz-opacity: 0;
-webkit-opacity: 0;
transition: all .3s ease-in;
-o-transition: all .3s ease-in;
-ms-transition: all .3s ease-in;
-moz-transition: all .3s ease-in;
-webkit-transition: all .3s ease-in;
}
.parsley-errors-list.filled {
opacity: .5;
}
.suggest1{
opacity: .45;
margin-left:68px;
position:absolute;
top:153px;
font-style: italic;
}
.suggest2{
opacity: .45;
margin-left:68px;
width:150px;
position:absolute;
top:202px;
font-style: italic;
}
.suggest3{
opacity: .45;
margin-left:68px;
position:absolute;
top:297px;
font-style: italic;
}
.suggest4{
opacity: .45;
margin-left:68px;
position:absolute;
top:344px;
font-style: italic;
}
.suggest5{
opacity: .45;
margin-left:68px;
position:absolute;
top:392px;
width:132px;
font-style: italic;
}
.suggest6{
opacity: .45;
margin-left:68px;
position:absolute;
top:440px;
width:132px;
font-style: italic;
}
.suggest7{
color: red;
opacity: .75;
margin-left:325px;
position:absolute;
top:252px;
width:132px;
font-size:14px;
}
.suggest8{
opacity: .45;
margin-left:68px;
position:absolute;
top:489px;
width:132px;
font-style: italic;
}