How do I display "Confirm Password" in a single line ?
I add an <span id="confirm">Confirm Password</span> and I did this, doesn't work:
#confirm {
display: inline;
}
* {
margin: 0px;
padding: 0px;
}
body {
background-color: Royalblue; /*#f0f0f0;*/
}
.head {
text-align: center;
border: 1px solid #B0C4DE;
border-bottom: none;
border-radius: 10px 10px 0px 0px;
padding: 20px;
background: rgba(0, 250, 0, 0);
color: #FFFACD;
font-family: 'Cinzel', sans-serif;
font-size:30px;
}
.content {
position:relative;
top:8px;
width: 30%;
margin: 50px
auto 0px;
}
form {
position: relative;
margin-top: 0;
margin-left: 0;
width: 89%;
height: 300px;
padding: 20px;
border: 1px solid #B0C4DE;
background: rgba(0, 250, 0, 0);
border-radius: 0px 0px 10px 10px;
}
label {
position: relative;
font-family: 'Montserrat', sans-serif;
font-size: 14px;
z-index: -1;
border: 0;
color: white;
left: -65%;
top: -30px;
}
.username {
position: relative;
top: 65px;
}
.password {
position: relative;
top: 130px;
}
.con-pass {
position: relative;
top: 195px;
}
#confirm {
display: inline;
}
input {
position: absolute;
font-family: 'Montserrat', sans-serif;
border: 0;
border-bottom: 2px solid beige;
background: transparent;
font-size: 15px; /*BORDER yes/no*/
height: 25px;
width: 250px;
outline: 0;
z-index: 1;
left: -74px;
top: -30px;
}
span {
position: absolute;
top: 5px;
left: -6px;
transition: top .5s ease, font-size .5s ease;
}
input:focus + label > span,
input:valid + label > span {
top: -20px;
font-size: 11px;
/* padding-bottom: 15px;*/
}
label::after {
content: '';
position: absolute;
top: 27px; /* ::after position */
left: -7px;
width: 250px;
height: 23px;
border-radius: 2px;
transition: transform .3s;
}
label::after {
z-index: -1;
background: beige; /*#a86bf;*/
transform: scale3d(1, 0, 1);
transform-origin: top;
}
input:focus + label::after,
input:valid + label::after {
transform: scale3d(1, -1.3, 1);
transition-timing-function: linear;
top: 27px; /* ::after position */
}
input:focus {
border-radius: 2px;
}
<div class="content">
<p class="head">Register</p>
<form>
<div class="content">
<div class="email">
<input type="text" id="email" required /> <!--input field-->
<label for="email"><span>Email</span></label>
</div>
<div class="username">
<input type="text" id="user" required />
<label for="user"><span>Username</span></label>
</div>
<div class="password">
<input type="text" id="pass" required /> <!--input field-->
<label for="pass"><span>Password</span></label>
</div>
<div class="con-pass">
<input type="text" id="c-pass" required />
<label for="c-pass"><span id="confirm">Confirm Password</span></label>
</div>
</div>
</form>
</div>
You can use white-space: nowrap; for that :
#confirm {
white-space: nowrap;
}
Here is a resource for the white-space property in CSS.
Use white-space: nowrap; for class con-pass
You can also insert a in your html. That will ensure the two Words are kept on the same line:
<label for="c-pass"><span id="confirm">Confirm Password</span></label>
Related
I need help with the Select Dropdown. It moves the content (Hello World) when opened. I have used Radio Input to select the specfic option when performing a Search. If there is any other better solution for this type of functionality, please assist.
HTML
<span class="dropdown-el">
<input type="radio" name="sortType" value="Relevance" checked="checked" id="sort-relevance"><label for="sort-relevance">Relevance</label>
<input type="radio" name="sortType" value="Popularity" id="sort-best"><label for="sort-best">Product Popularity</label>
<input type="radio" name="sortType" value="PriceIncreasing" id="sort-low"><label for="sort-low">Price Low to High</label>
<input type="radio" name="sortType" value="PriceDecreasing" id="sort-high"><label for="sort-high">Price High to Low</label>
<input type="radio" name="sortType" value="ProductBrand" id="sort-brand"><label for="sort-brand">Product Brand</label>
<input type="radio" name="sortType" value="ProductName" id="sort-name"><label for="sort-name">Product Name</label>
</span>
<h1> Hello World</h1>
CSS
body {
text-align: center;
background: #ebf4fb;
min-height: 95vh;
margin: 0;
padding: 0;
border-bottom: 5vh solid #3694d7;
font-family: "Myriad Pro", "Arial", sans;
font-size: 24px;
}
.dropdown-el {
margin-top: 20vh;
min-width: 12em;
position: relative;
display: inline-block;
margin-right: 1em;
min-height: 2em;
max-height: 2em;
overflow: hidden;
top: 0.5em;
cursor: pointer;
text-align: left;
white-space: nowrap;
color: #444;
outline: none;
border: 0.06em solid transparent;
border-radius: 1em;
background-color: #cde4f5;
transition: 0.3s all ease-in-out;
}
.dropdown-el input:focus + label {
background: #def;
}
.dropdown-el input {
width: 1px;
height: 1px;
display: inline-block;
position: absolute;
opacity: 0.01;
}
.dropdown-el label {
border-top: 0.06em solid #d9d9d9;
display: block;
height: 2em;
line-height: 2em;
padding-left: 1em;
padding-right: 3em;
cursor: pointer;
position: relative;
transition: 0.3s color ease-in-out;
}
.dropdown-el label:nth-child(2) {
margin-top: 2em;
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el input:checked + label {
display: block;
border-top: none;
position: absolute;
top: 0;
width: 100%;
}
.dropdown-el input:checked + label:nth-child(2) {
margin-top: 0;
position: relative;
}
.dropdown-el::after {
content: "";
position: absolute;
right: 0.8em;
top: 0.9em;
border: 0.3em solid #3694d7;
border-color: #3694d7 transparent transparent transparent;
transition: 0.4s all ease-in-out;
}
.dropdown-el.expanded {
border: 0.06em solid #3694d7;
background: #fff;
border-radius: 0.25em;
padding: 0;
box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 5px 0px;
max-height: 15em;
}
.dropdown-el.expanded label {
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el.expanded label:hover {
color: #3694d7;
}
.dropdown-el.expanded input:checked + label {
color: #3694d7;
}
.dropdown-el.expanded::after {
transform: rotate(-180deg);
top: 0.55em;
}
JQuery
$('.dropdown-el').click(function(e) {
e.preventDefault();
e.stopPropagation();
$(this).toggleClass('expanded');
$('#'+$(e.target).attr('for')).prop('checked',true);
});
$(document).click(function() {
$('.dropdown-el').removeClass('expanded');
});
https://codepen.io/libsys/pen/bGKomaE
Please assist.
As you can see in the title I want to show Divs related to my check-box radio button. I looked for past topics about that and I try to do it with some scripts but I failed. I know Im missing somethings.
What I want to do is; when click on Second button (check-box radio tool 2) I want to open div class row3. and When click on First button (check-box radio tool 1) I want to open div class row2.
Maybe it is so easy but Im new on this stuffs. Any help or sugestion would be great.
Thanks..
/* PRODUCTS AND BUTTONS */
.button {
position: absolute;
bottom: 0%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
background-color: #d8d8d8cc;
color: rgb(0, 0, 0);
font-size: 70%;
width: 70%;
height: 20%;;
border: none;
cursor: pointer;
border-radius: 7px;
text-align: center;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
.container2 {
position: relative;
width: 100%;
max-width: 400px;
}
.container2 img {
width: 100%;
height: auto;
border-radius: 10px;
}
.container2 img {
width: 100%;
height: auto;
border-radius: 10px;
}
.column2 {
float: center;
width: 2300%;
padding:8px;
}
.row2 {
width: 80%;
padding:5px;
position: relative;
left: 23%;
bottom: 5%;
margin-top:5%;
}
/* Clearfix (clear floats) */
.row2::after {
content: "";
clear: both;
display: table;
}
.row3 {
width: 80%;
padding:5px;
position: relative;
left: 23%;
bottom: 5%;
margin-top:5%;
}
/* Clearfix (clear floats) */
.row3::after {
content: "";
clear: both;
display: table;
}
*:focus {
outline: 0 !important;
}
/* PRODUCTS AND BUTTONS END */
/* Split the screen in half */
.split {
height: 100%;
width: 50%;
position: fixed;
z-index: 1;
top: 0;
overflow-x: hidden;
padding-top: 20px;
}
/* Control the left side */
.left {
left: 0;
background-color: rgb(240, 240, 240);
}
/* Control the right side */
.right {
right: 0;
background-color: rgb(255, 255, 255);
}
/* If you want the content centered horizontally and vertically */
.centered {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.centered2 {
position: fixed;
top: 50%;
left: 55%;
transform: translate(-50%, -50%);
text-align: center;
}
/* Style the image inside the centered container, if needed */
.centered img {
width: 150px;
border-radius: 50%;
}
/* Please ❤ this if you like it! */
#import url('https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&subset=devanagari,latin-ext');
:root {
--white: #ffffff;
--light: #f0eff3;
--black: #000000;
--dark-blue: #ffffff;
--dark-light: #ffffff;
--red: #d8d8d8;
--yellow: #d8d8d8;
--grey: #ecedf3;
}
/* #Primary
================================================== */
body{
width: 100%;
background: var(--dark-blue);
overflow-x: hidden;
font-family: 'Poppins', sans-serif;
font-size: 17px;
line-height: 30px;
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
p{
font-family: 'Poppins', sans-serif;
font-size: 17px;
line-height: 30px;
color: var(--white);
letter-spacing: 1px;
font-weight: 500;
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
::selection {
color: var(--white);
background-color: var(--black);
}
::-moz-selection {
color: var(--white);
background-color: var(--black);
}
mark{
color: var(--white);
background-color: var(--black);
}
.section {
position: relative;
width: 100%;
}
.over-hide {
overflow: hidden;
}
.z-bigger {
z-index: 100 !important;
}
.background-color{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--dark-blue);
z-index: 1;
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox:checked ~ .background-color{
background-color: var(--white);
}
[type="checkbox"]:checked,
[type="checkbox"]:not(:checked),
[type="radio"]:checked,
[type="radio"]:not(:checked){
position: absolute;
left: -9999px;
width: 0;
height: 0;
visibility: hidden;
}
.checkbox:checked + label,
.checkbox:not(:checked) + label{
position: relative;
width: 70px;
display: inline-block;
padding: 0;
margin: 0 auto;
text-align: center;
margin: 17px 0;
margin-top: 100px;
height: 6px;
border-radius: 4px;
background-image: linear-gradient(298deg, var(--red), var(--yellow));
z-index: 100 !important;
}
.checkbox:checked + label:before,
.checkbox:not(:checked) + label:before {
position: absolute;
font-family: 'unicons';
cursor: pointer;
top: 17px;
z-index: 2;
font-size: 20px;
line-height: 40px;
text-align: center;
width: 40px;
height: 40px;
border-radius: 50%;
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox:not(:checked) + label:before {
content: '\eac1';
left: 0;
color: var(--grey);
background-color: var(--dark-light);
}
.checkbox:checked + label:before {
content: '\eb8f';
left: 30px;
color: var(--yellow);
background-color: var(--dark-blue);
}
.checkbox:checked ~ .section .container .row .col-12 p{
color: var(--dark-blue);
}
.checkbox-tools:checked + label,
.checkbox-tools:not(:checked) + label{
position: relative;
padding: 15px;
width: 50px;
float: left;
font-size: 14px;
line-height: 20px;
letter-spacing: 1px;
margin: 0 auto;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 10px;
text-align: center;
border-radius: 7px;
overflow: hidden;
cursor: pointer;
text-transform: uppercase;
color: var(--white);
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox-tools:not(:checked) + label{
background-color: var(--dark-light);
}
.checkbox-tools:checked + label{
background-color: transparent;
}
.checkbox-tools:not(:checked) + label:hover{
box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.2);
}
.checkbox-tools:checked + label::before,
.checkbox-tools:not(:checked) + label::before{
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 4px;
background-image: linear-gradient(298deg, var(--red), var(--yellow));
z-index: -1;
}
.checkbox-tools:checked + label .uil,
.checkbox-tools:not(:checked) + label .uil{
font-size: 24px;
line-height: 24px;
display: block;
padding-bottom: 10px;
}
.checkbox:checked ~ .section .container .row .col-12 .checkbox-tools:not(:checked) + label{
background-color: var(--light);
color: var(--dark-blue);
box-shadow: 0 1x 4px 0 rgba(0, 0, 0, 0.05);
}
.checkbox-budget:checked + label,
.checkbox-budget:not(:checked) + label{
position: relative;
display: inline-block;
padding: 0;
padding-top: 20px;
padding-bottom: 20px;
width: 260px;
font-size: 52px;
line-height: 52px;
font-weight: 700;
letter-spacing: 1px;
margin: 0 auto;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 10px;
text-align: center;
border-radius: 4px;
overflow: hidden;
cursor: pointer;
text-transform: uppercase;
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
-webkit-text-stroke: 1px var(--white);
text-stroke: 1px var(--white);
-webkit-text-fill-color: transparent;
text-fill-color: transparent;
color: transparent;
}
.checkbox-budget:not(:checked) + label{
background-color: var(--dark-light);
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}
.checkbox-budget:checked + label{
background-color: transparent;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.checkbox-budget:not(:checked) + label:hover{
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.checkbox-budget:checked + label::before,
.checkbox-budget:not(:checked) + label::before{
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 4px;
background-image: linear-gradient(138deg, var(--red), var(--yellow));
z-index: -1;
}
.checkbox-budget:checked + label span,
.checkbox-budget:not(:checked) + label span{
position: relative;
display: block;
}
.checkbox-budget:checked + label span::before,
.checkbox-budget:not(:checked) + label span::before{
position: absolute;
content: attr(data-hover);
top: 0;
left: 0;
width: 100%;
overflow: hidden;
-webkit-text-stroke: transparent;
text-stroke: transparent;
-webkit-text-fill-color: var(--white);
text-fill-color: var(--white);
color: var(--white);
-webkit-transition: max-height 0.3s;
-moz-transition: max-height 0.3s;
transition: max-height 0.3s;
}
.checkbox-budget:not(:checked) + label span::before{
max-height: 0;
}
.checkbox-budget:checked + label span::before{
max-height: 100%;
}
.checkbox:checked ~ .section .container .row .col-xl-10 .checkbox-budget:not(:checked) + label{
background-color: var(--light);
-webkit-text-stroke: 1px var(--dark-blue);
text-stroke: 1px var(--dark-blue);
box-shadow: 0 1x 4px 0 rgba(0, 0, 0, 0.05);
}
.checkbox-booking:checked + label,
.checkbox-booking:not(:checked) + label{
position: relative;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-ms-flex-pack: center;
text-align: center;
padding: 0;
padding: 6px 25px;
font-size: 14px;
line-height: 30px;
letter-spacing: 1px;
margin: 0 auto;
margin-left: 6px;
margin-right: 6px;
margin-bottom: 16px;
text-align: center;
border-radius: 4px;
cursor: pointer;
color: var(--white);
text-transform: uppercase;
background-color: var(--dark-light);
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox-booking:not(:checked) + label::before{
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}
.checkbox-booking:checked + label::before{
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.checkbox-booking:not(:checked) + label:hover::before{
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.checkbox-booking:checked + label::before,
.checkbox-booking:not(:checked) + label::before{
position: absolute;
content: '';
top: -2px;
left: -2px;
width: calc(100% + 4px);
height: calc(100% + 4px);
border-radius: 4px;
z-index: -2;
background-image: linear-gradient(138deg, var(--red), var(--yellow));
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox-booking:not(:checked) + label::before{
top: -1px;
left: -1px;
width: calc(100% + 2px);
height: calc(100% + 2px);
}
.checkbox-booking:checked + label::after,
.checkbox-booking:not(:checked) + label::after{
position: absolute;
content: '';
top: -2px;
left: -2px;
width: calc(100% + 4px);
height: calc(100% + 4px);
border-radius: 4px;
z-index: -2;
background-color: var(--dark-light);
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox-booking:checked + label::after{
opacity: 0;
}
.checkbox-booking:checked + label .uil,
.checkbox-booking:not(:checked) + label .uil{
font-size: 20px;
}
.checkbox-booking:checked + label .text,
.checkbox-booking:not(:checked) + label .text{
position: relative;
display: inline-block;
-webkit-transition: opacity 300ms linear;
transition: opacity 300ms linear;
}
.checkbox-booking:checked + label .text{
opacity: 0.6;
}
.checkbox-booking:checked + label .text::after,
.checkbox-booking:not(:checked) + label .text::after{
position: absolute;
content: '';
width: 0;
left: 0;
top: 50%;
margin-top: -1px;
height: 2px;
background-image: linear-gradient(138deg, var(--red), var(--yellow));
z-index: 1;
-webkit-transition: all 300ms linear;
transition: all 300ms linear;
}
.checkbox-booking:not(:checked) + label .text::after{
width: 0;
}
.checkbox-booking:checked + label .text::after{
width: 100%;
}
.checkbox:checked ~ .section .container .row .col-12 .checkbox-booking:not(:checked) + label,
.checkbox:checked ~ .section .container .row .col-12 .checkbox-booking:checked + label{
background-color: var(--light);
color: var(--dark-blue);
}
.checkbox:checked ~ .section .container .row .col-12 .checkbox-booking:checked + label::after,
.checkbox:checked ~ .section .container .row .col-12 .checkbox-booking:not(:checked) + label::after{
background-color: var(--light);
}
.link-to-page {
position: fixed;
top: 30px;
right: 30px;
z-index: 20000;
cursor: pointer;
width: 50px;
}
.link-to-page img{
width: 100%;
height: auto;
display: block;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="main.css" />
<link rel="stylesheet" href="main.js" />
<title>REXIN 3D-AR DEMO</title>
<style>
</style>
</head>
<body>
<div class="split left">
</div>
<div class="split right">
<div class="centered2">
<div class="section over-hide z-bigger">
<input class="checkbox" type="checkbox" name="general" id="general">
<div class="section over-hide z-bigger">
<div class="container pb-5">
<div class="row justify-content-center pb-5">
<div class="col-12 pb-5">
<input class="checkbox-tools" type="radio" name="tools" id="tool-1" checked>
<label class="for-checkbox-tools" for="tool-1">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/Location_dot_black.svg" width="100%" height="100%">
</label>
<br>
<input class="checkbox-tools" type="radio" name="tools" id="tool-2">
<label class="for-checkbox-tools" for="tool-2">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/Location_dot_black.svg" width="100%" height="100%">
</label>
<br>
<input class="checkbox-tools" type="radio" name="tools" id="tool-3">
<label class="for-checkbox-tools" for="tool-3">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/Location_dot_black.svg" width="100%" height="100%">
</label>
<br>
<input class="checkbox-tools" type="radio" name="tools" id="tool-4">
<label class="for-checkbox-tools" for="tool-4">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/Location_dot_black.svg" width="100%" height="100%">
</label>
<br>
<input class="checkbox-tools" type="radio" name="tools" id="tool-5">
<label class="for-checkbox-tools" for="tool-5">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/Location_dot_black.svg" width="100%" height="100%">
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row2">
<div class="column2">
<div class="container2">
<img src="Assets/photos/terrassen.jpg" alt="Snow" style="width:100%">
<a href="terrassendach.html"> <button class="button" style="vertical-align:top">
<span>Terrassendach </span></button></a>
</div>
</div>
<div class="column2">
<div class="container2">
<img src="Assets/photos/pergolen.jpg" alt="Snow" style="width:100%">
<a href="pergolen.html"> <button class="button" style="vertical-align:top">
<span>Pergolen </span></button></a>
</div>
</div>
<div class="column2">
<div class="container2">
<img src="Assets/photos/carport.jpg" alt="Snow" style="width:100%">
<a href="carport.html"> <button class="button" style="vertical-align:top">
<span>Carport </span></button></a>
</div>
</div>
<div class="column2">
<div class="container2">
<img src="Assets/photos/Vordächer.jpg" alt="Snow" style="width:100%">
<a href="vordacher.html"> <button class="button" style="vertical-align:top">
<span>Vordächer </span></button></a>
</div>
</div>
</div>
<div class="row3">
<div class="column2">
<div class="container2">
<img src="Assets/photos/terrassen.jpg" alt="Snow" style="width:100%">
<a href="terrassendach.html"> <button class="button" style="vertical-align:top">
<span>Terrassendach </span></button></a>
</div>
</div>
<div class="column2">
<div class="container2">
<img src="Assets/photos/pergolen.jpg" alt="Snow" style="width:100%">
<a href="pergolen.html"> <button class="button" style="vertical-align:top">
<span>Pergolen </span></button></a>
</div>
</div>
<div class="column2">
<div class="container2">
<img src="Assets/photos/carport.jpg" alt="Snow" style="width:100%">
<a href="carport.html"> <button class="button" style="vertical-align:top">
<span>Carport </span></button></a>
</div>
</div>
<div class="column2">
<div class="container2">
<img src="Assets/photos/Vordächer.jpg" alt="Snow" style="width:100%">
<a href="vordacher.html"> <button class="button" style="vertical-align:top">
<span>Vordächer </span></button></a>
</div>
</div>
</div>
</div>
</body>
Try this! (Run code snippet to see)
Codepen: https://codepen.io/dhanushbadge/pen/kICBu
Made by: #Dhanush Badge
function show1(){
document.getElementById('div1').style.display ='none';
}
function show2(){
document.getElementById('div1').style.display = 'block';
}
body {
font-family: arial;
}
.hide {
display: none;
}
p {
font-weight: bold;
}
<p>How many check boxes do you want when clicked on a radio button?</p>
<input type="radio" name="tab" value="igotnone" onclick="show1();" />
None
<input type="radio" name="tab" value="igottwo" onclick="show2();" />
Two
<div id="div1" class="hide">
<hr><p>Okay Cool! Here are those two...</p>
<input type="checkbox" value="Yes" name="one">
One
<input type="checkbox" value="Yes" name="two">
Two
</div>
There's a little royalblue background appearing (between border-bottom: 2px solid white; & ::after element) when I unfocus.
I don't know why is that happening.
body {
background-color: royalblue;/*#f0f0f0;*/
}
label {
font-family: 'Montserrat', sans-serif;
font-size: 14px;
z-index: -1;
border: 0;
color: white;
position: relative;
}
.head {
color: white;
margin-left: 44%;
font-family: monospace;
font-size: 25px;
}
/*.content {
margin-top: 10%;
margin-left: 41%;
}*/
.password {
margin-top: 8%;
}
form {
position: relative;
}
input {
position: absolute;
font-family: 'Montserrat', sans-serif;
font-size: 15px;
background: transparent;
border: 0; /* BORDER yes/no */
border-bottom: 2px solid white;
background: transparent;
outline: 0;
height: 25px;
width: 180px;
z-index: 1;
margin-top: 5px;
}
/*input:focus {
outline: 1;
}*/
label::after {
content: '';
position: absolute;
top: -2px;
left: 0;
width: 180px;
height: 25px;
border-radius: 2px;
transition: transform .3s;
}
label::after{
z-index: -1;
background: beige; /*#a86bf;*/
transform: scale3d(1, 0, 1);
transform-origin: 0% 0%;
}
input:focus {
border-radius: 1px;
}
input:focus + label::after,
input:valid + label::after {
transform: scale3d(1, -1, 1);
transition-timing-function: linear;
}
span {
position: relative;
margin-top: -30px;
display: block;
padding: .6em 0;
padding-left: -5px;
transition: top .5s ease, font-size .5s ease;
/* transition: transform 1s 2s;*/
top: 0;
}
input:focus + label > span,
input:valid + label > span {
top: -20px;
font-size: 11px;
padding-bottom: 15px;
}
/* font-family: monospace;*/
/*transform: translate3d(0, -80%, 0); */
/* transition-timing-function: linear;*/
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<title>Test</title>
</head>
<body>
<p class="head">Sign In</p>
<form>
<div class="content">
<div class="username">
<input type="text" name="name" class="user-input" id="user" required /> <!--input field-->
<label class="user-label" for="user"><span>Username</span></label>
</div>
<div class="password">
<input type="text" name="name" class="pass-input" id="pass" required /> <!-- input field -->
<label class="pass-label" for="pass"><span>Password</span></label>
</div>
</div>
</form>
</body>
</html>
Update:
I changed to top: 1px;, also change border-bottom to black, now this is the result (full code). Why is there some excess scale at the bottom? how to remove those?
You have a top: -2px on label, and your problem is when you blur, so a solution is move top: -2px to input:focus + label::after and input:focus + label::after, so you dont have that gap when its not focused or validated
body {
background-color: royalblue;/*#f0f0f0;*/
}
label {
font-family: 'Montserrat', sans-serif;
font-size: 14px;
z-index: -1;
border: 0;
color: white;
position: relative;
}
.head {
color: white;
margin-left: 44%;
font-family: monospace;
font-size: 25px;
}
/*.content {
margin-top: 10%;
margin-left: 41%;
}*/
.password {
margin-top: 8%;
}
form {
position: relative;
}
input {
position: absolute;
font-family: 'Montserrat', sans-serif;
font-size: 15px;
background: transparent;
border: 0; /* BORDER yes/no */
border-bottom: 2px solid white;
background: transparent;
outline: 0;
height: 25px;
width: 180px;
z-index: 1;
margin-top: 5px;
}
/*input:focus {
outline: 1;
}*/
label::after {
content: '';
position: absolute;
left: 0;
width: 180px;
height: 25px;
border-radius: 2px;
transition: transform .3s;
}
label::after{
z-index: -1;
background: beige; /*#a86bf;*/
transform: scale3d(1, 0, 1);
transform-origin: 0% 0%;
}
input:focus {
border-radius: 1px;
}
input:focus + label,
input:valid + label {
top: -2px;
}
input:focus + label::after,
input:valid + label::after {
transform: scale3d(1, -1, 1);
transition-timing-function: linear;
}
span {
position: relative;
margin-top: -30px;
display: block;
padding: .6em 0;
padding-left: -5px;
transition: top .5s ease, font-size .5s ease;
top: 0;
}
input:focus + label > span,
input:valid + label > span {
top: -20px;
font-size: 11px;
padding-bottom: 15px;
}
/* font-family: monospace;*/
/*transform: translate3d(0, -80%, 0); */
/* transition-timing-function: linear;*/
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<title>Test</title>
</head>
<body>
<p class="head">Sign In</p>
<form>
<div class="content">
<div class="username">
<input type="text" name="name" class="user-input" id="user" required /> <!--input field-->
<label class="user-label" for="user"><span>Username</span></label>
</div>
<div class="password">
<input type="text" name="name" class="pass-input" id="pass" required /> <!-- input field -->
<label class="pass-label" for="pass"><span>Password</span></label>
</div>
</div>
</form>
</body>
</html>
you have an extra code, you can see here in comment section
label::after {
content: '';
position: absolute;
/*top: -2px;*/
left: 0;
width: 180px;
height: 25px;
border-radius: 2px;
transition: transform .3s;
}
Add top:1px on label::after See Below.
label::after {
content: '';
position: absolute;
left: 0;
top: 1px;
width: 180px;
height: 25px;
border-radius: 2px;
transition: transform .3s;
}
I Googled for the above mentioned problem, but I still require the help from the stack overflow community.
In my login form, I am using font awesome icon. I have 2 input boxes for username and password respectively.
I want to display fa-user-cirle icon on top of the username input. The login form is displayed in a div as follows:
<div class="loginDiv">
<form>
<i class="fa fa-user-circle"></i>
<div class="container">
<input type="text" placeholder="Username" name="uname" required>
<input type="password" placeholder="Password" name="psw" required>
<button mat-button (click)="submit()">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</div>
The CSS for icon is:
#import '~#angular/material/theming';
#include mat-core();
$yaana-app-primary: mat-palette($mat-orange, 800,400,200);
.firstDiv {
height: 40%;
width: 100%;
top: 0;
left: 0;
right: 0;
position: absolute;
background-color: orangered;
display: inline-block;
}
.secondDiv {
position: absolute;
width: 100%;
bottom: 0;
height: 60%;
left: 0;
right: 0;
background-color:whitesmoke;
display: inline-block;
}
.loginDiv {
border: 1px solid black;
background: white;
left: 50%;
position: absolute;
top: 28%;
transform: translate(-50%);
background-color: #fff;
padding: 15px;
box-shadow:1px 3px 10px rgba(0, 0, 0, 0.34);
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
width: 215px;
height: 36px;
line-height: 36px;
background: transparent;
border-radius: 3px;
will-change: transform;
-webkit-transition: all .2s ease;
transition: all .2s ease;
border: none;
/*border: 2px solid #FF5126;*/
cursor: pointer;
background: #F26722;
font-size: 16px;
color: #fff;
outline: none;
text-align: center;
padding: 0 6px;
margin: 6px 8px;
font-size: 14px;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase !important;
}
button:hover {
opacity: 0.8;
}
.loginImgContainer {
display: table;
max-height: 40px;
max-width: 40px;
}
i.fa {
background: #fff;
display: inline-block;
transform: scale(4,4);
border-radius: 50%;
}
The output I am getting is as follows:
But I want the icon to appear just above the username input and at the centre.
Please help me.
Adding this 'centericon' Class and css
.centericon{
font-size:36px;
position:absolute;
top:-18px;
left:50%;
transform:translate(-50%,0);
z-index:99;
background:white;
}
.firstDiv {
height: 40%;
width: 100%;
top: 0;
left: 0;
right: 0;
position: absolute;
background-color: orangered;
display: inline-block;
}
.secondDiv {
position: absolute;
width: 100%;
bottom: 0;
height: 60%;
left: 0;
right: 0;
background-color:whitesmoke;
display: inline-block;
}
.loginDiv {
border: 1px solid black;
background: white;
left: 50%;
position: absolute;
top: 28%;
transform: translate(-50%);
background-color: #fff;
padding: 15px;
box-shadow:1px 3px 10px rgba(0, 0, 0, 0.34);
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
width: 215px;
height: 36px;
line-height: 36px;
background: transparent;
border-radius: 3px;
will-change: transform;
-webkit-transition: all .2s ease;
transition: all .2s ease;
border: none;
/*border: 2px solid #FF5126;*/
cursor: pointer;
background: #F26722;
font-size: 16px;
color: #fff;
outline: none;
text-align: center;
padding: 0 6px;
margin: 6px 8px;
font-size: 14px;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
text-transform: uppercase !important;
}
button:hover {
opacity: 0.8;
}
.loginImgContainer {
display: table;
max-height: 40px;
max-width: 40px;
}
.centericon{
font-size:36px;
position:absolute;
top:-18px;
left:50%;
transform:translate(-50%,0);
z-index:99;
background:white;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<div class="loginDiv">
<form>
<div class="centericon">
<i class="fa fa-user-circle"></i>
</div>
<div class="container">
<input type="text" placeholder="Username" name="uname" required>
<input type="password" placeholder="Password" name="psw" required>
<button mat-button (click)="submit()">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</div>
Try with adding row above the container,
<div class="loginDiv">
<form>
<div class="row center">
<i class="fa fa-user-circle"></i>
</div>
<div class="container">
<input type="text" placeholder="Username" name="uname" required>
<input type="password" placeholder="Password" name="psw" required>
<button mat-button (click)="submit()">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</div>
Thanks for giving me hint and found out the solution with following changes in css,
i.fa {
background: #fff;
display: inline-block;
font-size: 80px;
transform: translateY(-60%);
transform: translateX(160%);
border-radius: 50%;
}
I have two slideshows made in pure CSS in an html page, each one is inside its own tooltip but one of them (Piediluco) doesn't work properly because its images doesn't slide correctly.
body {
background-color: #000000;
}
.tooltip, .tooltip2 {
position: relative;
display: inline-block;
padding: 400px 0 0 0;
margin: 0;
cursor: pointer;
color: #5790ce;
}
.tooltip:hover .info, .tooltip:focus .info,
.tooltip2:hover .info2, .tooltip2:focus .info2 {
visibility: visible;
opacity: 1;
transform: translate3d(0, 0, 0);
}
.info, .info2 {
box-sizing: border-box;
position: absolute;
bottom: -380px;
left: 95px;
display: block;
background: #FFFFFF;
border: 1px solid #000000;
width: 500px;
font-size: 25px;
line-height: 24px;
text-align: justify;
cursor: text;
visibility: hidden;
opacity: 0;
transform: translate3d(0, -20px, 0);
transition: all .5s ease-out;
}
.info:before, .info2:before {
position: absolute;
content: '';
width: 100%;
height: 14px;
bottom: -14px;
left: 0;
}
.info:after, .info2:after {
position: absolute;
content: '';
width: 10px;
height: 10px;
transform: rotate(45deg);
bottom: 378px;
right: 494px;
margin-left: -5px;
background: #8d7200;
}
#i1, #i2, #i3, #i4,
#i12, #i22, #i32, #i42 {
display: none;
}
.container, .container2 {
margin: 0;
position: relative;
width: 100%;
height: 120px;
padding-bottom: 38%;
user-select: none;
background-color: #1c1c1c;
}
.container .slide_img,
.container2 .slide_img2 {
position: absolute;
width: 100%;
height: 100%;
}
.container .slide_img .img,
.container2 .slide_img2 .img2 {
width: inherit;
height: inherit;
}
.container .slide_img .caption,
.container2 .slide_img2 .caption2 {
position: relative;
display: inline-block;
width: 100%;
bottom: 46px;
text-align: center;
padding-top: 5px;
padding-bottom: 14px;
background-color: rgba(242,242,242,.5);
color: #FFFFFF;
}
.lblp, .lbln, .lblp2, .lbln2 {
width: 12%;
height: 22%;
position: absolute;
top: 40%;
background-color: rgba(242,242,242,.3);
z-index: 99;
transition: background-color 1s;
cursor: pointer;
}
.lbln, .lbln2 {
right: 0;
border-radius: 5px 0 0 5px;
}
.lblp, .lblp2 {
left: 0;
border-radius: 0 5px 5px 0;
}
.lblp:hover, .lbln:hover,
.lblp2:hover, .lbln2:hover {
background-color: rgba(242,242,242,.1);
}
.prev, .prev2 {
position: absolute;
font-family: Arial, sans-serif;
color: rgba(244, 244, 244,.9);
font-size: 40pt;
padding: 0 0 15px 20px;
margin: 0;
top: 25%;
transition: color 1s;
}
.next, .next2 {
position: absolute;
font-family: Arial, sans-serif;
color: rgba(244, 244, 244,.9);
font-size: 40pt;
padding: 0 0 15px 25px;
margin: 0;
top: 25%;
transition: color 1s;
}
.prev:hover, .next:hover,
.prev2:hover, .next2:hover {
color: rgba(244, 244, 244,1);
}
.slide_img, .slide_img2 {
z-index: -1;
}
#i1:checked ~ #one,
#i2:checked ~ #two,
#i3:checked ~ #three,
#i4:checked ~ #four,
#i12:checked ~ #one2,
#i22:checked ~ #two2,
#i32:checked ~ #three3,
#i42:checked ~ #four2 {
z-index: 9;
animation: scroll 1s ease-in-out;
}
#keyframes scroll{
0%{ opacity:.4;}
100%{opacity:1;}
}
.text, .text2 {
display: block;
padding: 14px 17px 35px 17px;
color: #8d7200;
}
.more, .more2 {
display: inline;
position: relative;
bottom: 20px;
left: 215px;
margin: 0;
padding: 3px 10px;
font-family: 'Times New Roman', sans-serif;
text-decoration: none;
color: green;
font-size: 20px;
font-weight: bold;
border: 2px solid green;
border-radius: 5px;
transition: background-color 0.5s, color 0.5s;
}
.more:hover, .more:focus,
.more2:hover, .more2:focus {
background-color: green;
color: #FFFFFF;
}
<div onclick="void(0);" class="tooltip">Trasimeno
<div class="info">
<div class="container">
<input type="radio" id="i1" name="images" checked>
<input type="radio" id="i2" name="images">
<input type="radio" id="i3" name="images">
<input type="radio" id="i4" name="images">
<div class="slide_img" id="one">
<img class="img" src="https://i.imgur.com/W5E69l9.jpg">
<span class="caption">...................</span>
<label class="lblp" for="i4"><span class="prev">‹</span></label>
<label class="lbln" for="i2"><span class="next">›</span></label>
</div>
<div class="slide_img" id="two">
<img class="img" src="https://i.imgur.com/eGbNeOB.jpg">
<span class="caption">...................</span>
<label class="lblp" for="i1"><span class="prev">‹</span></label>
<label class="lbln" for="i3"><span class="next">›</span></label>
</div>
<div class="slide_img" id="three">
<img class="img" src="https://i.imgur.com/hp2OiNB.jpg">
<span class="caption">...................</span>
<label class="lblp" for="i2"><span class="prev">‹</span></label>
<label class="lbln" for="i4"><span class="next">›</span></label>
</div>
<div class="slide_img" id="four">
<img class="img" src="https://i.imgur.com/MHZj0eb.jpg">
<span class="caption">...................</span>
<label class="lblp" for="i3"><span class="prev">‹</span></label>
<label class="lbln" for="i1"><span class="next">›</span></label>
</div>
</div>
<div class="text">...................................................</div>
<a class="more" href="#" target="_blank">More</a>
</div>
</div>
<div onclick="void(0);" class="tooltip2">Piediluco
<div class="info2">
<div class="container2">
<input type="radio" id="i12" name="images2" checked>
<input type="radio" id="i22" name="images2">
<input type="radio" id="i32" name="images2">
<input type="radio" id="i42" name="images2">
<div class="slide_img2" id="one2">
<img class="img2" src="https://i.imgur.com/S12ZVXY.jpg">
<span class="caption2">.....................</span>
<label class="lblp2" for="i32"><span class="prev2">‹</span></label>
<label class="lbln2" for="i12"><span class="next2">›</span></label>
</div>
<div class="slide_img2" id="two2">
<img class="img2" src="https://i.imgur.com/3JcEZp7.jpg">
<span class="caption2">.....................</span>
<label class="lblp2" for="i32"><span class="prev2">‹</span></label>
<label class="lbln2" for="i12"><span class="next2">›</span></label>
</div>
<div class="slide_img2" id="three2">
<img class="img2" src="https://i.imgur.com/kayLkDW.jpg">
<span class="caption2">.....................</span>
<label class="lblp2" for="i32"><span class="prev2">‹</span></label>
<label class="lbln2" for="i12"><span class="next2">›</span></label>
</div>
<div class="slide_img2" id="four2">
<img class="img2" src="https://i.imgur.com/gfRwbU2.jpg">
<span class="caption2">.....................</span>
<label class="lblp2" for="i32"><span class="prev2">‹</span></label>
<label class="lbln2" for="i12"><span class="next2">›</span></label>
</div>
</div>
<div class="text2">...................................................</div>
<a class="more2" href="#" target="_blank">More</a>
</div>
</div>
How can I find the error/s?