Basically, I have price table with corner ribbon. On the price table, I've slide up transition on hover. When I hover on price table, the corner ribbon displace. Have a look at my code. I want to make the corner ribbon sticky on hover with sliding transition.
CSS
.zoom:hover {
transition: transform .5s ease;
-webkit-transition: 0.3s;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
transition: transform 300ms;
transform: translate3d(0, -1%, 0);
}
/* RIBBON CSS */
.container__wrapper {
left: 0px;
position: absolute;
top: 15px;
height: 141px;
width: 170px;
overflow: hidden;
}
.container__ribbon {
z-index: 100;
left: -60px;
position: absolute;
top: 40px;
height: 30px;
width: 230px;
transform: rotate(-45deg);
background-color: #FF0000;
display: flex;
align-content: center;
justify-content: center;
box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
}
.container__ribbon h6 {
font-size: 16px;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #fff;
align-self: center !important;
font-weight: 400;
padding-top: 0.3em;
}
/*___________________________________________________________ */
/* css for package */
/* SCROLLBARR CSS */
.card {
border: 0 !important;
}
.scrollbar-dusty-grass::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
background-color: #DAD8D9;
border-radius: 10px;
}
.scrollbar-dusty-grass::-webkit-scrollbar {
width: 12px;
background-color: #F5F5F5;
}
.scrollbar-dusty-grass::-webkit-scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.0);
background-image: -webkit-linear-gradient(330deg, #11A085 0%, #11A085 100%);
background-image: linear-gradient(120deg, #11A085 0%, #11A085 100%);
}
.bordered-cyan::-webkit-scrollbar-thumb {
box-shadow: none;
}
.square::-webkit-scrollbar-track {
border-radius: 0 !important;
}
.square::-webkit-scrollbar-thumb {
border-radius: 0 !important;
}
.thin::-webkit-scrollbar {
width: 6px;
}
.example-1 {
position: relative;
overflow-y: scroll;
height: 175px;
}
/* CAROUSEL */
.brderline {
margin-top: 1rem;
padding: .5rem;
border: 1px solid #11A085;
}
/* PACKAGES TITLE */
.packagetitle h4 {
color: #323232 !important;
font-size: 15px;
font-weight: 700;
}
.packagetitle h1 {
color: #323232 !important;
font-size: 35px;
font-weight: 800;
}
.pkpara {
font-family: 'Circular Std Book';
font-size: 25px;
color: #323232 !important;
font-weight: 100;
font-size: 20px;
}
/* PACKAGE BOX CSS */
/* .pk1 {
border: 1px solid #11A085;
} */
.tagimg {
position: absolute;
top: 2%;
left: 0;
width: 120px !important;
height: 120px;
}
.tagimg-r {
position: absolute;
top: 2%;
right: 0;
width: 120px !important;
height: 120px;
}
.pkg1 h5 {
font-size: 15px;
color: #11A085;
}
.pkg1 h2 {
font-size: 25px;
color: #323232;
font-weight: 700;
}
.pkg1 p {
font-size: 16px;
color: #8d8d8d;
text-decoration: line-through;
}
.pkg1 h1 {
color: #11A085;
font-size: 45px;
font-weight: 700;
margin-bottom: 1rem;
}
ul.pkg-items>li {
color: #323232;
list-style: none;
font-family: Circular Std Medium;
font-style: normal;
}
ul.pkg-items li::before {
content: "\2022";
color: #8d8d8d;
font-weight: bold;
display: inline-block;
width: 1.5rem;
}
.pkgbtn {
text-align: center;
margin: 2rem 0;
}
.innerpkgbtn {
padding: 20px 60px !important;
}
.pkg1 h6 {
font-size: 14px;
color: #8d8d8d;
}
.viewmre h4 {
padding: 1rem 0 !important;
font-size: 14px;
text-align: center;
}
.callnchat {
font-size: 16px;
text-align: center;
margin-bottom: 2rem;
}
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css">
<!-- Owl Carousel -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/assets/css/owl.carousel.css">
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/assets/css/owl.theme.green.css">
<script src="<?php echo BASE_URL; ?>/assets/js/jquery.min.js" type="text/javascript"></script>
<script src="<?php echo BASE_URL; ?>/assets/js/owl.carousel.min.js" type="text/javascript"></script>
<div class="item brderline zoom">
<div class="pt-2 pb-2 pkg1">
<div class="pk1">
<div class="container__wrapper">
<div class="container__ribbon">
<h6>Free Delivery Rush</h6>
</div>
</div>
<!-- <img src="assets/img/badgeleft.png" class="tagimg">s -->
<h5 class="text-center">LOGO PACKAGE</h5>
<h2 class="text-center">BASIC <br> LOGO PACKAGE</h2>
<p class="text-center">$339</p>
<h1 class="text-center">$45.00</h1>
<div class="card example-1 square scrollbar-dusty-grass square thin">
<ul class="pkg-items">
<li>3 Custom Logo Design Concepts</li>
<li>1 Dedicated Designer</li>
<li>4 Revisions</li>
<li>2 hours TAT</li>
<li>Unique Design Guarantee</li>
<li>100% Unique Design Guarantee</li>
<li>100% Satisfaction Guarantee</li>
<li>100% Money Back Guarantee *</li>
<li>100% Ownership Rights</li>
</ul>
</div>
<div class="pkgbtn"><button type="button" class="btn innerpkgbtn">ORDER NOW</button></div>
<h6 class="text-center">$50 Additional For Expedited Services </h6>
<div class="viewmre">
<h4> VIEW DETAILS</h4>
</div>
<div class="callnchat">
<i class="fas fa-phone-square-alt"></i>1·866·268·1794
<i class="fas fa-comment-dots"></i>LIVE CHAT
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery#3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/js/bootstrap.min.js" integrity="sha384-VHvPCCyXqtD5DqJeNxl2dtTyhF78xXNXdkwX1CZeRusQfRKp+tA7hAShOK/B/fQ2" crossorigin="anonymous"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js'></script>
**
absolute
The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. -MDN
Since .container__wrapper is positioned absolute, make it so it is relative to a parent that is also positioned and moves on hover, for example, the .item class. See the snippet below:
.zoom:hover {
transition: transform .5s ease;
-webkit-transition: 0.3s;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
transition: transform 300ms;
transform: translate3d(0, -1%, 0);
}
/* RIBBON CSS */
.container__wrapper {
left: 0px;
position: absolute;
top: 0px;
height: 141px;
width: 170px;
overflow: hidden;
}
.item {
position: relative;
}
.container__ribbon {
z-index: 100;
left: -60px;
position: absolute;
top: 40px;
height: 30px;
width: 230px;
transform: rotate(-45deg);
background-color: #FF0000;
display: flex;
align-content: center;
justify-content: center;
box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
}
.container__ribbon h6 {
font-size: 16px;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #fff;
align-self: center !important;
font-weight: 400;
padding-top: 0.3em;
}
/*___________________________________________________________ */
/* css for package */
/* SCROLLBARR CSS */
.card {
border: 0 !important;
}
.scrollbar-dusty-grass::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
background-color: #DAD8D9;
border-radius: 10px;
}
.scrollbar-dusty-grass::-webkit-scrollbar {
width: 12px;
background-color: #F5F5F5;
}
.scrollbar-dusty-grass::-webkit-scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.0);
background-image: -webkit-linear-gradient(330deg, #11A085 0%, #11A085 100%);
background-image: linear-gradient(120deg, #11A085 0%, #11A085 100%);
}
.bordered-cyan::-webkit-scrollbar-thumb {
box-shadow: none;
}
.square::-webkit-scrollbar-track {
border-radius: 0 !important;
}
.square::-webkit-scrollbar-thumb {
border-radius: 0 !important;
}
.thin::-webkit-scrollbar {
width: 6px;
}
.example-1 {
position: relative;
overflow-y: scroll;
height: 175px;
}
/* CAROUSEL */
.brderline {
margin-top: 1rem;
padding: .5rem;
border: 1px solid #11A085;
}
/* PACKAGES TITLE */
.packagetitle h4 {
color: #323232 !important;
font-size: 15px;
font-weight: 700;
}
.packagetitle h1 {
color: #323232 !important;
font-size: 35px;
font-weight: 800;
}
.pkpara {
font-family: 'Circular Std Book';
font-size: 25px;
color: #323232 !important;
font-weight: 100;
font-size: 20px;
}
/* PACKAGE BOX CSS */
/* .pk1 {
border: 1px solid #11A085;
} */
.tagimg {
position: absolute;
top: 2%;
left: 0;
width: 120px !important;
height: 120px;
}
.tagimg-r {
position: absolute;
top: 2%;
right: 0;
width: 120px !important;
height: 120px;
}
.pkg1 h5 {
font-size: 15px;
color: #11A085;
}
.pkg1 h2 {
font-size: 25px;
color: #323232;
font-weight: 700;
}
.pkg1 p {
font-size: 16px;
color: #8d8d8d;
text-decoration: line-through;
}
.pkg1 h1 {
color: #11A085;
font-size: 45px;
font-weight: 700;
margin-bottom: 1rem;
}
ul.pkg-items>li {
color: #323232;
list-style: none;
font-family: Circular Std Medium;
font-style: normal;
}
ul.pkg-items li::before {
content: "\2022";
color: #8d8d8d;
font-weight: bold;
display: inline-block;
width: 1.5rem;
}
.pkgbtn {
text-align: center;
margin: 2rem 0;
}
.innerpkgbtn {
padding: 20px 60px !important;
}
.pkg1 h6 {
font-size: 14px;
color: #8d8d8d;
}
.viewmre h4 {
padding: 1rem 0 !important;
font-size: 14px;
text-align: center;
}
.callnchat {
font-size: 16px;
text-align: center;
margin-bottom: 2rem;
}
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css">
<!-- Owl Carousel -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/assets/css/owl.carousel.css">
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/assets/css/owl.theme.green.css">
<script src="<?php echo BASE_URL; ?>/assets/js/jquery.min.js" type="text/javascript"></script>
<script src="<?php echo BASE_URL; ?>/assets/js/owl.carousel.min.js" type="text/javascript"></script>
<div class="item brderline zoom">
<div class="pt-2 pb-2 pkg1">
<div class="pk1">
<div class="container__wrapper">
<div class="container__ribbon">
<h6>Free Delivery Rush</h6>
</div>
</div>
<!-- <img src="assets/img/badgeleft.png" class="tagimg">s -->
<h5 class="text-center">LOGO PACKAGE</h5>
<h2 class="text-center">BASIC <br> LOGO PACKAGE</h2>
<p class="text-center">$339</p>
<h1 class="text-center">$45.00</h1>
<div class="card example-1 square scrollbar-dusty-grass square thin">
<ul class="pkg-items">
<li>3 Custom Logo Design Concepts</li>
<li>1 Dedicated Designer</li>
<li>4 Revisions</li>
<li>2 hours TAT</li>
<li>Unique Design Guarantee</li>
<li>100% Unique Design Guarantee</li>
<li>100% Satisfaction Guarantee</li>
<li>100% Money Back Guarantee *</li>
<li>100% Ownership Rights</li>
</ul>
</div>
<div class="pkgbtn"><button type="button" class="btn innerpkgbtn">ORDER NOW</button></div>
<h6 class="text-center">$50 Additional For Expedited Services </h6>
<div class="viewmre">
<h4> VIEW DETAILS</h4>
</div>
<div class="callnchat">
<i class="fas fa-phone-square-alt"></i>1·866·268·1794
<i class="fas fa-comment-dots"></i>LIVE CHAT
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery#3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/js/bootstrap.min.js" integrity="sha384-VHvPCCyXqtD5DqJeNxl2dtTyhF78xXNXdkwX1CZeRusQfRKp+tA7hAShOK/B/fQ2" crossorigin="anonymous"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js'></script>
More on position's here.
Related
at first im completly new to CSS and have a Question about my half working animation.
So I got an Container an this Container I wanted to slide from the Header to the normal Position but the Animation goes only the halfway and then its just starting spring without an animation to the normal Position.
Here is my CSS Code maybe you find anything I did wrong or something that I can do better to avoid those Problems.
And yeah I know my class name are not good, I just tried out CSS for the first time.
body{
font-family: 'Open Sans', sans-serif;
background-color: #f3f5f6;
padding-left: 100px;
padding-right: 100px;
}
.class-image{
width: 100%;
height: 500px;
object-fit: cover;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
border-radius: 10px 10px 0px 0px;
object-position: 30% 60%;
display: block;
}
.colorChange{
font-size: 20px;
font-weight: bold;
color: black;
}
.containerClass{
padding: 16px;
vertical-align: middle;
animation: example 2s linear;
width:85%;
position:absolute;
}
.navbar{
display: flex;
justify-content: space-between;
align-items: center;
}
a{
color: #831D17;
text-decoration: none;
margin-left: 16px;
font-weight: 700;
}
a:hover{
font-weight:bolder;
color: white;
padding-left: 8px;
padding-right: 8px;
display: inline-block;
line-height: 200%;
font-size: 16px;
border-radius: 20px;
background-color: #333333;
text-decoration: none;
}
#keyframes example {
0% {
bottom:100vH
}
100% {
bottom: 0vH
}
}
.highlight{
color: black;
font-weight: bolder;
font-size: 48px;
}
.Fotoind{
background-color:#333333;
color: #D6D6D6;
font-weight: 600;
border-radius: 0px 0px 10px 10px;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
padding: 16px;
}
.MapsContainer{
margin-top: 16px;
width: 100%; border-radius: 10px; overflow: hidden;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
display: flex;
justify-content:space-between ;
}
.maps-right{
background-color:#333333;
color: #D6D6D6;
font-weight: 600;
border-radius: 0px 0px 0px 0px;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
padding: 16px;
margin-left: 16px;
width: 30%;
}
.mapStyle{
border: 0;
height: 350px;
width: 70%;
}
.contentdown{
padding: 8px;
}
.legal{
margin-right: 16px;
}
<body>
<div class="navbar">
<h1 class="colorChange">Der Blaue Planet<br>
<span class="highlight"> Die Erde</span>
</h1>
<div>
google
Termin
Preise
Kalender
</div>
</div>
<div class="containerClass">
<img class="class-image" src="Bilder/4k.jpg">
<div class="Fotoind">
Individuelle Fotos
</div>
<div class="MapsContainer">
<iframe class="mapStyle" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2429.8384006473802!2d13.596700815695565!3d52.48206157980705!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47a849b423ae37e9%3A0x1c91decc13ce5a24!2sMechthildstra%C3%9Fe%2053%2C%2012623%20Berlin!5e0!3m2!1sde!2sde!4v1633806883383!5m2!1sde!2sde"
allowfullscreen="" loading="lazy"></iframe>
<div class="maps-right">
Ein Fast proffesionelles Seiten Layout
</div>
</div>
<div class="contentdown">
<span class="legal"> Copyright von morgen </span> | Impressum | Datenschutz
</div>
</div>
</body>
I used margin-top instead of bottom property and it works fine.
#keyframes example {
0% {
margin-top: calc(-100vh - 100%);
}
100% {
margin-top: 0vh
}
}
I added this to jsfiddle. Link
I have a problem. I am trying to make simple HTML-based website. I want to make the image and the white fields "full" the screen (width 100%) but it is somehow limited from both sides with some sort of margin. I am a fresh webguy so probably the solution is simple but so far I cannot find it.
<!DOCTYPE HTML>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>ARSPOLSKA</title>
<link rel="stylesheet" href="css/styl.css" type="text/css">
</head>
<body>
<!-- ========= HEADER ========= -->
<div class="belka-menu">
<div class="limiter">
<div id="logo"></div>
<p>TECHNICZNE ZAOPATRZENIE PRZEMYSŁU</p>
<nav class="nawigacja">
<ul>
<li>REGULAMIN</li>
<li>KATALOG PRODUKTÓW</li>
<li>PROMOCJE</li>
<li>STRONA GŁÓWNA</li>
</ul>
</nav>
</div>
</div>
<!-- ====== HEADER ====== -->
<!-- ====== SLIDER ====== -->
<div class="slider-imitation"></div>
<!-- ====== SLIDER ====== -->
<!-- ====== ZAWARTOSC ====== -->
<div class="container-item">
<div id="item">
<div class="foto"><img src="http://www.adamscrew.cba.pl/wordpress/wp-content/themes/arspolska/img/img1.jpg"/></div>
<div class="text">
Jesteśmy firmą handlową zajmującą się obsługą i zaopatrzeniem oraz wsparciem technicznym dla
działów utrzymania ruchu zakładów i firm.
</div>
</div>
<div id="item">
<div class="foto"><img src="http://www.adamscrew.cba.pl/wordpress/wp-content/themes/arspolska/img/img4.jpg"/></div>
<div class="text">
Posiadamy zaplecze umożliwiające wykonanie prac związanych z obróbką, skrawaniem,
pracami związanymi ze spawaniem oraz szeroko pojętymi usługami.
</div>
</div>
<div id="item">
<div class="foto"><img src="http://www.adamscrew.cba.pl/wordpress/wp-content/themes/arspolska/img/img3.jpg"/></div>
<div class="text">
Współpracujemy z największymi dystrybutorami dzięki temu otrzymują Państwo produkty najwyższej jakości w 100% oryginalne.
</div>
</div>
<div id="item">
<div class="foto"><img src="http://www.adamscrew.cba.pl/wordpress/wp-content/themes/arspolska/img/img2.jpg"/></div>
<div class="text">
Jesteśmy w stanie dostosować się do potrzeb każdego przedsiębiorstwa.
</div>
</div>
</div>
<!-- ====== ZAWARTOSC ====== -->
<!-- ====== STOPKA ====== -->
<footer class="stopka">
<div class="limiter">
<div class="stopka-logo"></div>
<div class="stopka-info">
<h1>ARSPOLSKA Jóźkowicz i wspólnicy Sp. J.</h1>
<p>ul. Przemysłowa 14B</p>
<p>59-300 Lubin</p>
<p>NIP 692-250-43-38</p>
</div>
<div class="stopka-info">
<h1>KONTAKT</h1>
<p>tel: 515 012 162</p>
<p><b>kontakt#arspolska.com</b></p>
</div>
<div class="podstopka">Copyright © 2017 ARSPOLSKA Wszystkie prawa zastrzeżone.</div>
</div>
</footer>
<!-- ====== STOPKA ====== -->
</body>
</html>
/* ====== GLOBALNE ====== */
#font-face {
font-family: "Open Sans";
src: url('../OpenSans.ttf'), url('../OpenSans.eot');
/* IE */
}
body {
font-family: "Open Sans", Times, serif;
background-color: #f1f1f1;
}
h1 {
margin-top: 0;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-weight: normal;
color: #333;
}
#logo {
background-image: url("../img/logo.png");
background-size: 90px;
height: 87px;
width: 133px;
z-index: 999999;
float: left;
background-repeat: no-repeat;
margin-top: 1px;
}
.limiter {
width: 1200px;
margin: auto;
}
.slider-imitation {
height: 586px;
width: 100%;
background-image: url(../img/1.png);
background-attachment: fixed;
background-position: center;
}
/* ====== MENU ====== */
.belka-menu p {
font-family: "Open Sans";
font-size: 15px;
color: #979797;
padding-top: 25px;
padding-left: 120px;
position: absolute;
}
.belka-menu {
position: fixed;
display: block;
width: 100%;
z-index: 99;
border-top: 5px solid #f05928;
background-color: #ffffff;
height: 90px;
right: 0;
top: 0;
-webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.4);
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.4);
}
/* ====== NAWIGACJA ====== */
.nawigacja li {
position: relative;
display: inline-block;
padding: 10px;
font-weight: 500;
background-color: #fff;
text-align: center;
padding-top: 25px;
float: right;
}
.nawigacja li a {
color: #979797;
font-size: 16px;
font-family: "Open Sans";
}
.nawigacja li a:hover {
color: #f05928;
-webkit-transition: width 2s;
/* For Safari 3.1 to 6.0 */
transition: color 0.5s;
text-decoration: none;
font-weight: bold;
}
/* ====== STOPKA ====== */
.stopka {
padding: 40px 0;
color: #999;
background-color: #fff;
border-top: 1px solid #e5e5e5;
margin-top: 40px;
clear: both;
text-align: left;
height: 200px;
}
.stopka-info {
display: block;
height: 100%;
margin: auto 20px;
max-width: 300px;
float: left;
line-height: 13px;
}
.stopka-logo {
background-image: url('../img/logo.png');
display: block;
height: 140px;
width: 140px;
max-height: 140px;
max-height: 140px;
float: left;
margin-right: 20px;
background-repeat: no-repeat;
}
.podstopka {
display: block;
background-color: #f05928;
height: 30px;
padding-top: 5px;
padding-left: 20px;
padding-right: 20px;
margin: auto;
clear: both;
color: #fff;
}
/*====== CONTAINER ======*/
.container-home {
width: 100%;
height: 200px;
background-color: #ffffff;
clear: both;
}
.container-item {
text-align: center;
height: 400px;
width: 100%;
display: block;
background-color: #ffff;
clear: both;
-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.9);
-moz-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.9);
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.9);
}
#item {
border: 1px solid #e5e5e5;
background-color: #fff;
display: inline-block;
width: 250px;
height: 300px;
padding-top: 15px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 10px;
margin-top: 50px;
margin-left: 10px;
margin-right: 10px;
vertical-align: top;
}
h1 {
font-weight: bold;
color: #8e8e8e;
font-size: 14px;
}
#item:hover {
border: 2px solid #f05928;
-webkit-transition: -webkit-transform 4s;
/* Safari */
transition: transform 4s;
}
.text {
margin-top: 20px;
font-size: 13px;
text-align: center;
}
.foto img {
width: auto;
height: auto;
max-width: 220px;
max-height: 220px;
}
.box {
height: 100%;
padding-top: 25px;
padding-bottom: 25px;
margin-top: 50px;
}
You probably need to set your body margin. By default your browser has some margins (8px on Chrome) so the content will not appear behind the scrollbar.
body {
font-family: "Open Sans", Times, serif;
background-color: #f1f1f1;
margin: 0;
padding: 0;
border: 0;
}
I have buttons as active and deactive. These buttons are used as toggle. I want center align text in button. Please help.
Here is code snippet in Plunker
CSS Code
body {
font-family: 'Montserrat', sans-serif;
background-color: #E5E5E5;
min-width: 1280px;
overflow: scroll;
}
/* toggle switch style ======================================= */
.profile_status {
padding: 6px 50px 0px 0px;
}
.active_inactive_container {
display: inline-block;
height: 28px;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
padding: 2px 0px 2px 2px;
}
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
height: 22px;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 5px 0px 18px;
}
.clicked_active_button {
background-color: #51B151 !important;
color: #FFFFFF !important;
margin-left: 62px;
position: absolute;
opacity: 0;
}
.clicked_active_button1 {
opacity: 1 !important;
-webkit-transform: translateX(-140px);
-ms-transform: translateX(-140px);
transform: translateX(-140px);
transition: .1s;
}
.clicked_inactive_button {
background-color: #f75252 !important;
color: #FFFFFF !important;
margin-left: 6px;
position: absolute;
opacity: 0;
}
.clicked_active_switch {
margin-left: 78px !important;
}
Html Code
<div class="active_inactive_container toggle_switch_container">
<button class="clicked_inactive_button clicked_inactive_switch ng-binding">Inactive</button>
<button class="active_button ng-binding" ng-click="">Active</button>
<button class="clicked_active_button clicked_active_switch ng-binding clicked_active_button1" >Active</button>
<button class="inactive_button ng-binding" >Inactive</button>
</div>
How to centralize the Active and Inactive button text?
change padding
.active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button {
background-color: #ffffff;
border: medium none !important;
border-radius: 15px;
color: #333333;
font-size: 11px;
height: 22px;
outline: medium none;
padding: 0 11px;
}
remove the height and play with the padding of the container it will work .
.active_inactive_container {
display: inline-block;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
padding: 6px 10px;
}
Padding for the buttons is the problem padding: 0px 5px 0px 18px;
try changing it like this
padding: 0px 10px 0px 10px;
margin: 0px 0px 0px 23px;
This may not be the best solution out there
Update
Here is a working fiddle: http://codepen.io/anon/pen/WoBVZM?editors=0100
Below is the class I changed, just modified padding and added margin.
I used padding to fix the text alignment issue and margin to center the button.
.active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button
{
height: 22px;
background-color:#FFFFFF;
border:none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 10px 0px 10px;
margin: 2px 5px;
}
I found that by adding the padding: 0 11px; to .active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button your problem will be resolved. Also i added some margin to .active_inactive_container button.
Please check the entire CSS Changes below.
.active_inactive_container button{
margin:3px;
}
.active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button
{
height: 22px;
background-color:#FFFFFF;
border:none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0 11px;
}
You mean like this?
body {
font-family: 'Montserrat', sans-serif;
background-color: #E5E5E5;
min-width: 1280px;
overflow: scroll;
}
.profile_status {
padding: 6px 50px 0px 0px;
}
.active_inactive_container {
display: table;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
}
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
display: table-cell;
vertical-align: middle;
padding: 1rem;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
text-align: center;
outline: none;
font-size: 11px;
margin: 0;
}
You need to add the padding to get the text in center. i have created demo for both active and inactive option selected.
edited padding in this class
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
height: 22px;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 18px 0px 18px;
}
Example :
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
body {
font-family: 'Montserrat', sans-serif;
background-color: #E5E5E5;
min-width: 1280px;
overflow: scroll;
}
/* toggle switch style ======================================= */
.profile_status {
padding: 6px 50px 0px 0px;
}
.active_inactive_container {
display: inline-block;
height: 28px;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
padding: 2px 0px 2px 2px;
}
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
height: 22px;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 18px 0px 18px;
}
.clicked_active_button {
background-color: #51B151 !important;
color: #FFFFFF !important;
margin-left: 62px;
position: absolute;
opacity: 0;
}
.clicked_active_button1 {
opacity: 1 !important;
-webkit-transform: translateX(-140px);
-ms-transform: translateX(-140px);
transform: translateX(-140px);
transition: .1s;
}
.clicked_inactive_button1 {
opacity: 1 !important;
-webkit-transform: translateX(-140px);
-ms-transform: translateX(-140px);
transform: translateX(-140px);
transition: .1s;
}
.clicked_inactive_button {
background-color: #f75252 !important;
color: #FFFFFF !important;
margin-left: 6px;
position: absolute;
opacity: 0;
}
.clicked_active_switch {
margin-left: 78px !important;
}
.clicked_inactive_switch {
margin-left: 198px !important;
}
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<script data-require="angular.js#1.4.x" src="https://code.angularjs.org/1.4.12/angular.js" data-semver="1.4.9"></script>
<link data-require="bootstrap#4.0.5" data-semver="4.0.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<script data-require="bootstrap#4.0.5" data-semver="4.0.5" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl as $ctrl">
<div class="active_inactive_container toggle_switch_container">
<button class="clicked_inactive_button clicked_inactive_switch ng-binding">Inactive</button>
<button class="active_button ng-binding" ng-click="$ctrl.toggleSwitchOn()">Active</button>
<button class="clicked_active_button clicked_active_button1 clicked_active_switch ng-binding " >Active</button>
<button class="inactive_button ng-binding" ng-click="$ctrl.toggleSwitchOff()">Inactive</button>
</div>
<div class="active_inactive_container toggle_switch_container">
<button class="clicked_inactive_button clicked_inactive_switch clicked_inactive_button1 ng-binding">Inactive</button>
<button class="active_button ng-binding" ng-click="$ctrl.toggleSwitchOn()">Active</button>
<button class="clicked_active_button clicked_active_switch ng-binding " >Active</button>
<button class="inactive_button ng-binding" ng-click="$ctrl.toggleSwitchOff()">Inactive</button>
</div>
</body>
</html>
I am trying to build a responsive notification bar with bootstrap, however my media query are not behaving properly,
I have some text with tag which I want to decrease size on smaller screen but only my timer text is changing size. also I want to add some margin between my text and button on smaller screen, but its not working.
Please look at my code and suggest some changes :|
$(function() {
var endDate = new Date();
endDate = new Date(2016, 12 - 1, 31);
$('#dcountdown').countdown({
until: endDate
});
$('#dclose').click(function() {
$(this).parent().slideUp();
});
});
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic);
#media only screen and (max-width: 700px){.dcontent strong{font-size: 50%;}.countdown-section{font-size: 80%;padding-bottom: 10%;} .mybutton{padding: 2px;}}
#dbanner {
position: top;
bottom: 0px;
height: auto;
width: 100%;
padding: 10px 0 10px 0;
color: #fff;
text-align: center;
font-family: "Open Sans";
text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.8);
}
.dcontent {
padding: 0px 30px 0px 30px;
font-size: 16px;
}
.dcontent strong {
font-size: 20px;
color: #fff;
white-space: nowrap;
margin-right: 30%;
text-align: center;
}
#dclose {
position: absolute;
font-size: 8px;
height: 20px;
line-height: 10px;
top: 5px;
right: 10px;
color: #fff;
}
#dclose:hover {
cursor: pointer;
}
.change-color {
background-color: #000000;
color: #FFF;
text-align: center;
}
.mybutton{
padding: 5px;
background: #006622;
background-size: 100%;
border-radius: 0px;
color: #fff;
}
.countdown-section {
padding: 0 5px 0 5px;
text-align: center;
}
.countdown-amount {
padding: 0 5px 0 0;
}
.countdown-period {
text-transform: none;
}
.countdown-descr {
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<div id="dbanner" class="change-color">
<div class="dcontent">
<strong>Some Text Here Some Text Here Some </strong> <span id="dcountdown"></span> Apply Now
</div>
<div id="dclose">close me!</div>
</div>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.countdown.min.js"></script>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.plugin.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Thank you
Mobile View
The previous issue has been fixed now, but on mobile view there is some white space on the right side, how do I fix that
Mobile View new
Move whole statement #media only screen and (max-width: 700px) {... ...} down of your rules. Then it should work right.
$(function() {
var endDate = new Date();
endDate = new Date(2016, 12 - 1, 31);
$('#dcountdown').countdown({
until: endDate
});
$('#dclose').click(function() {
$(this).parent().slideUp();
});
});
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic);
#dbanner {
position: top;
bottom: 0px;
height: auto;
width: 100%;
padding: 10px 0 10px 0;
color: #fff;
text-align: center;
font-family: "Open Sans";
text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.8);
}
.dcontent {
padding: 0px 30px 0px 30px;
font-size: 16px;
}
.dcontent strong {
font-size: 20px;
color: #fff;
white-space: nowrap;
margin-right: 30%;
text-align: center;
}
#dclose {
position: absolute;
font-size: 8px;
height: 20px;
line-height: 10px;
top: 5px;
right: 10px;
color: #fff;
}
#dclose:hover {
cursor: pointer;
}
.change-color {
background-color: #000000;
color: #FFF;
text-align: center;
}
.mybutton{
padding: 5px;
background: #006622;
background-size: 100%;
border-radius: 0px;
color: #fff;
}
.countdown-section {
padding: 0 5px 0 5px;
text-align: center;
}
.countdown-amount {
padding: 0 5px 0 0;
}
.countdown-period {
text-transform: none;
}
.countdown-descr {
}
#media only screen and (max-width: 700px){
.dcontent strong {
font-size: 50%;
}
.countdown-section {
font-size: 80%;
padding-bottom: 10%;
}
.mybutton {
padding: 2px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<div id="dbanner" class="change-color">
<div class="dcontent">
<strong>Some Text Here Some Text Here Some </strong> <span id="dcountdown"></span> Apply Now
</div>
<div id="dclose">close me!</div>
</div>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.countdown.min.js"></script>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.plugin.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
I created two buttons that I would like to place under my input login boxes. I want it to be responsive so I used the absolute value but when I move them, the buttons suddenly overlap! Any solutions? Here is my index and stylesheet:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(hero.jpeg);
background-size: cover;
background-position: center;
height: 100vh;
}
.login {
position: absolute;
/* Turns the the text box to absolute from static (allows free control of placement) */
width: 100%;
max-width: 420px;
top: 30%;
left: 0px;
right: 0px;
height: auto;
font-size: 20pt;
margin: 0px auto;
padding: 15px;
}
#space-password {
padding-top: 20px;
}
html {
color: whitesmoke;
font-weight: 100;
font-family: 'Lato', 'Arial', sans-serif;
text-rendering: optimizeLegibility;
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(hero.jpeg);
}
input {
border-radius: 50px;
height: 38px;
width: 100%;
color: aliceblue;
border: 2px solid #999;
background-color: #34495e;
box-sizing: border-box;
padding-left: 14px;
padding-right: 14px;
margin-top: 5px;
font-size: 17px;
font-family: 'Lato', 'Arial', sans-serif;
}
.btn:link,
.btn:visited {
display: inline-block;
padding: 10px 30px;
/*This padding and border radius round border and define how big it is */
font-weight: 300;
text-decoration: none;
border-radius: 200px;
transition: background-color 0.2s, border 0.2s, color 0.2s;
/* makes color subtly change instead of instantly. More applealing */
}
.btn-full:link,
.btn-full:visited {
background-color: #3498db;
/* From flat UI colors */
border: 1px solid #3498db;
color: #fff;
}
.btn-ghost:link,
.btn-ghost:visited {
border: 1px solid #3498db;
color: #3498db;
}
.btn:hover,
.btn:active {
background-color: #7cbde8;
}
.btn-full:hover,
.btn-full:active {
border: 1px solid #3498db;
/* Fixed issue of text disipearing in color and borders being different color for both full and ghost */
}
.btn-ghost:hover,
.btn-ghost:active {
border: 1px solid #3498db;
color: #fff;
}
<!DOCTYPE>
<html lan="en">
<head>
<link rel="stylesheet" type="text/css" href="vendors/css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400" rel="stylesheet">
<title>Welcome-Sign in</title>
</head>
<body>
<header>
<form class="login">
<p>Apple ID:</p>
<br>
<input type="text" name="Apple ID">
<br>
<p id="space-password">Password:</p>
<br>
<input type="password" name="Password">
</form>
<div>
<a class="btn btn-full" href="#">Login</a>
<a class="btn btn-ghost" href="#">Don't have an acount? Sign up!</a>
</div>
</header>
</body>
</html>
Try this...
There is no relation between position:absolute and responsive design.
Since you intend to do this with absolute, Just place your button div into the form.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(hero.jpeg);
background-size: cover;
background-position: center;
height: 100vh;
}
.login {
position: absolute;
/* Turns the the text box to absolute from static (allows free control of placement) */
width: 100%;
max-width: 420px;
top: 30%;
left: 0;
right: 0px;
height: auto;
font-size: 20pt;
margin: 0px auto;
padding: 15px;
}
#space-password {
padding-top: 20px;
}
html {
color: whitesmoke;
font-weight: 100;
font-family: 'Lato', 'Arial', sans-serif;
text-rendering: optimizeLegibility;
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(hero.jpeg);
}
input {
border-radius: 50px;
height: 38px;
width: 100%;
color: aliceblue;
border: 2px solid #999;
background-color: #34495e;
box-sizing: border-box;
padding-left: 14px;
padding-right: 14px;
margin-top: 5px;
font-size: 17px;
font-family: 'Lato', 'Arial', sans-serif;
}
.btn{
margin-top:30px;
font-size: 14px !important;
}
.btn:link,
.btn:visited {
display: inline-block;
padding: 10px 30px;
/*This padding and border radius round border and define how big it is */
font-weight: 300;
text-decoration: none;
border-radius: 200px;
transition: background-color 0.2s, border 0.2s, color 0.2s;
/* makes color subtly change instead of instantly. More applealing */
}
.btn-full:link,
.btn-full:visited {
background-color: #3498db;
/* From flat UI colors */
border: 1px solid #3498db;
color: #fff;
}
.btn-ghost:link,
.btn-ghost:visited {
border: 1px solid #3498db;
color: #3498db;
}
.btn:hover,
.btn:active {
background-color: #7cbde8;
}
.btn-full:hover,
.btn-full:active {
border: 1px solid #3498db;
/* Fixed issue of text disipearing in color and borders being different color for both full and ghost */
}
.btn-ghost:hover,
.btn-ghost:active {
border: 1px solid #3498db;
color: #fff;
}
<!DOCTYPE>
<html lan="en">
<head>
<link rel="stylesheet" type="text/css" href="vendors/css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400" rel="stylesheet">
<title>Welcome-Sign in</title>
</head>
<body>
<header>
<form class="login">
<p>Apple ID:</p>
<br>
<input type="text" name="Apple ID">
<br>
<p id="space-password">Password:</p>
<br>
<input type="password" name="Password">
<div>
<a class="btn btn-full" href="#">Login</a>
<a class="btn btn-ghost" href="#">Don't have an acount? Sign up!</a>
</div>
</form>
</header>
</body>
</html>
Edit: This is for your comment. Also i recommend you to make use of Media queries for responsive layout.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(hero.jpeg);
background-size: cover;
background-position: center;
height: 100vh;
}
.login {
position: absolute;
/* Turns the the text box to absolute from static (allows free control of placement) */
width: 100%;
max-width: 420px;
top: 30%;
left: 0;
right: 0px;
height: auto;
font-size: 20pt;
margin: 0px auto;
padding: 15px;
}
#space-password {
padding-top: 20px;
}
html {
color: whitesmoke;
font-weight: 100;
font-family: 'Lato', 'Arial', sans-serif;
text-rendering: optimizeLegibility;
background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(hero.jpeg);
}
input {
border-radius: 50px;
height: 38px;
width: 100%;
color: aliceblue;
border: 2px solid #999;
background-color: #34495e;
box-sizing: border-box;
padding-left: 14px;
padding-right: 14px;
margin-top: 5px;
font-size: 17px;
font-family: 'Lato', 'Arial', sans-serif;
}
.btn {
margin-top: 30px;
font-size: 14px !important;
}
.btn:link,
.btn:visited {
display: inline-block;
padding: 10px 30px;
/*This padding and border radius round border and define how big it is */
font-weight: 300;
text-decoration: none;
border-radius: 200px;
transition: background-color 0.2s, border 0.2s, color 0.2s;
/* makes color subtly change instead of instantly. More applealing */
}
.btn-full:link,
.btn-full:visited {
background-color: #3498db;
/* From flat UI colors */
border: 1px solid #3498db;
color: #fff;
}
.btn-ghost:link,
.btn-ghost:visited {
border: 1px solid #3498db;
color: #3498db;
}
.btn:hover,
.btn:active {
background-color: #7cbde8;
}
.btn-full:hover,
.btn-full:active {
border: 1px solid #3498db;
/* Fixed issue of text disipearing in color and borders being different color for both full and ghost */
}
.btn-ghost:hover,
.btn-ghost:active {
border: 1px solid #3498db;
color: #fff;
}
.btns {
position: absolute;
/* Turns the the text box to absolute from static (allows free control of placement) */
width: 100%;
top: 300px;
left: 15%;
right: 0px;
height: auto;
font-size: 14pt;
margin: 0px auto;
padding: 15px;
}
<!DOCTYPE>
<html lan="en">
<head>
<link rel="stylesheet" type="text/css" href="vendors/css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400" rel="stylesheet">
<title>Welcome-Sign in</title>
</head>
<body>
<header>
<form class="login">
<p>Apple ID:</p>
<br>
<input type="text" name="Apple ID">
<br>
<p id="space-password">Password:</p>
<br>
<input type="password" name="Password">
</form>
<div class="btns">
<a class="btn btn-full" href="#">Login</a>
<a class="btn btn-ghost" href="#">Don't have an acount? Sign up!</a>
</div>
</header>
</body>
</html>
Instead of using <a></a> tag to create buttons you can use <button></button> tag to create button. This will avoid the overlapping of buttons.
<!DOCTYPE>
<html lan="en">
<head>
<link rel="stylesheet" type="text/css" href="vendors/css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400" rel="stylesheet">
<title>Welcome-Sign in</title>
</head>
<body>
<header>
<form class="login">
<p>Apple ID:</p><br>
<input type="text" name="Apple ID"><br>
<p id="space-password">Password:</p><br>
<input type="password" name="Password">
</form>
<div>
<button class="btn btn-full" >Login</button>
<button class="btn btn-ghost">Don't have an acount? Sign up! </button>
</div>
</header>
</body>