My CSS touch ripple is not working properly. It is just seen like a bubble in the center when i click on the button. Please help in finding where am i doing the mistake. i am not much known to CSS animations. i would like to do this using just CSS only.
.ripple-con,
.button {
display: inline-block;
position: relative;
overflow: hidden;
}
.button::after,
.ripple {
content: ' ';
background: rgba(0, 0, 0, 0.3);
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
display: inline-block;
border-radius: 100%;
}
.button:active::after,
.ripple:active,
.button:active+.ripple {
animation: ripple 2s;
}
#keyframes ripple {
to {
opacity: 0;
margin: -250px;
width: 500px;
height: 500px;
}
}
.button {
line-height: 39px;
border: 0;
height: 42px;
box-sizing: border-box;
padding: 0 20px;
background: #888;
border-radius: 5px;
cursor: default;
vertical-align: top;
}
html {
text-align: center
}
body {
display: inline-block
}
<div class="ripple-con">
<input class="button" type="submit" value="Submit Button : Button">
<span class="ripple"></span>
</div>
<div class="ripple-con">
<input class="button" type="button" value="Input Button : Button">
<span class="ripple"></span>
</div>
<div class="button">Div : Button</div>
<button class="button">Button : Button</button>
Just place animation: ripple inside .button::after, .ripple style definition and place animation: none where it goes active as follows
.ripple-con,
.button {
display: inline-block;
position: relative;
overflow: hidden;
}
.button::after,
.ripple {
content: ' ';
background: rgba(0, 0, 0, 0.3);
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
display: inline-block;
border-radius: 100%;
animation: ripple 2s;
}
.button:active::after,
.ripple:active,
.button:active + .ripple {
animation: none;
}
#keyframes ripple {
to {
opacity: 0;
margin: -250px;
width: 500px;
height: 500px;
}
}
.button {
line-height: 39px;
border: 0;
height: 42px;
box-sizing: border-box;
padding: 0 20px;
background: #888;
border-radius: 5px;
cursor: default;
vertical-align: top;
}
html {
text-align: center
}
body {
display: inline-block
}
<div class="ripple-con">
<input class="button" type="submit" value="Submit Button : Button">
<span class="ripple"></span>
</div>
<div class="ripple-con">
<input class="button" type="button" value="Input Button : Button">
<span class="ripple"></span>
</div>
<div class="button">Div : Button</div>
<button class="button">Button : Button</button>
Here is the fiddle
Related
***Dear all,
for a signup form, i tried to apply media queries rules in order that this flexbox form will appears center and fit the screeen. i have tried different option but i cannot find the solution.
can anyone help please?``
i leave as well my git repository.github project***
how can i make the login form apprearing in center and shrink in case of the screen is small?
<style lang="css" scoped>
.grp-login__grandParentContainer{
display: table;
height: 100%;
background-color:#d7ffd9;
font-size:25px;
margin: 0 auto;
}
.grp-login__parentContainer {
display:table-cell;
background-color:#eaffd7;
background-image: url('~#/assets/logosansnom.png');
height: 50px;
vertical-align: middle;
}
.grp-login__form {
border-style: solid;
border-color: black;
padding: 50px;
}
.grp-login__form__login__button {
width: 220px;
height: 50px;
border: none;
outline: none;
color: #fff;
background: red;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
margin: 50px;
font-size: 25px;
}
.grp-login__form__login__button:before {
content: '';
background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
position: absolute;
top: -2px;
left:-2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
opacity: 0;
transition: opacity .3s ease-in-out;
border-radius: 10px;
}
.grp-login__form__login__button:active {
color: red;
}
.grp-login__form__login__button:active:after {
background: transparent;
}
.grp-login__form__login__button:hover:before {
opacity: 1;
}
.grp-login__form__login__button:after {
z-index: -1;
content: '';
position: absolute;
width: 100%;
height: 100%;
background: orange;
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% { background-position: 0 0; }
50% { background-position: 400% 0; }
100% { background-position: 0 0; }
}
#media only screen and (max-width : 1024px) {
.grp-login__grandParentContainer {
display: table;
height: 150px;
background-color:#d7ffd9;
font-size:20px;
margin: 50px;
width: 60%;
}
.grp-login__parentContainer{
text-align:center;
}
}
</style>
<div class="grp-login__grandParentContainer">
<div class="grp-login__parentContainer">
<form class="grp-login__form">
<div class="grp-login__form__email">
<label class="">Email </label>
<input v-model="email" type="email" class="">
</div>
<div class="grp-login__form__password">
<label class="">Mot de passe </label>
<input v-model="password" type="password" class="">
</div>
<div class="grp-login__form__login">
<button #click= "goLogin" type= "button" class="grp-login__form__login__button">Login</button>
</div>
</form>
<div v-if="isError">Erreur de connexion</div>
</div>
</div>
I am trying to achieve this effect which I got on image. I am having trouble in creating custom shapes. Could someone assist me with this please?
body {
margin: 0;
}
.container {
display: flex;
width: 100%;
height: 100vh;
}
.menu {
background: lightgray;
flex: 0.1;
display: flex;
flex-direction: column;
padding-left: 15px;
}
.numbers {
background: #79726c;
border: none;
transform: skewY(10deg);
}
.content {
flex: 1;
background: blue;
}
<div class="container">
<div class="menu">
<button class="first">Start
</button>
<button class="numbers">1
</button>
<button class="numbers">2
</button>
</div>
<div class="content">
</div>
</div>
If you were only interested in the visual component, then it turned out quite similar:
body {
margin: 0;
display: flex;
justify-content: space-around;
align-items: center;
min-height: 100vh;
background-color: #312a28;
background-image: url("https://cdn.pixabay.com/photo/2016/11/27/05/02/texture-1862140_960_720.jpg");
}
.container {
position: relative;
display: flex;
height: 626px; width: 70vw;
}
.tabs {
position: relative;
top: 124px;
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
height: 464px; width: 66px;
user-select: none;
}
.tabs>input {
position: absolute !important;
height: 1px !important;
width: 1px !important;
border: none !important;
padding: 0 !important;
margin: 0 !important;
white-space: nowrap !important;
overflow: hidden !important;
clip: rect(1px, 1px, 1px, 1px) !important;
}
.tab {
position: relative;
left: 6px;
height: 34px; width: 66px;
border: none;
box-sizing: border-box;
font-size: 40px; line-height: 34px;
font-family: sans-serif; font-weight: bold;
text-align: center;
color: #f9f9f7;
background-color: #79726c;
filter: drop-shadow(-2px 8px 4px #0008);
transition: 0.3s ease;
}
.tab:nth-of-type(1) { z-index: 6; }
.tab:nth-of-type(2) { z-index: 5; }
.tab:nth-of-type(3) { z-index: 4; }
.tab:nth-of-type(4) { z-index: 3; }
.tab:nth-of-type(5) { z-index: 2; }
.tab:nth-of-type(6) { z-index: 1; }
.tab:nth-of-type(7) { z-index: 0; }
.tab::before,
.tab::after {
content: "";
position: absolute;
left: 0; z-index: -1;
width: 100%;
border-radius: 6px 4px 4px 6px;
background-color: inherit;
background-image: inherit;
}
.tab::before {
bottom: 16px; height: 126px;
transform: skewy(-28deg);
}
.tab::after {
top: 16px; height: 40px;
transform: skewy(28deg);
}
.tabs > input:not(:checked) + .tab:hover {
background-color: #aba5a0;
cursor: pointer;
}
.tabs > input:checked + .tab {
left: 0; z-index: 7;
background-color: #d8cec1;
background-image: url("https://cdn.pixabay.com/photo/2016/11/08/03/16/seamless-1807376_960_720.jpg");
color: #393534;
}
.tab .vertical {
position: absolute;
left: 10px; top: -85px;
transform: rotate(-90deg);
font-size: 12px;
text-transform: uppercase;
text-shadow: 0 0 2px currentcolor;
}
.content {
position: relative;
left: -3px; z-index: 8;
flex: 1;
border-radius: 6px;
background-color: #d8cec1;
background-image: url("https://cdn.pixabay.com/photo/2016/11/08/03/16/seamless-1807376_960_720.jpg");
box-shadow: 2px 13px 6px -4px #0008;
}
<section class="container">
<div class="tabs">
<input type="radio" name="tabs" id="tab0" checked><label for="tab0" class="tab"><span class="vertical">Start</span></label>
<input type="radio" name="tabs" id="tab1"><label for="tab1" class="tab">1</label>
<input type="radio" name="tabs" id="tab2"><label for="tab2" class="tab">2</label>
<input type="radio" name="tabs" id="tab3"><label for="tab3" class="tab">3</label>
<input type="radio" name="tabs" id="tab4"><label for="tab4" class="tab">4</label>
<input type="radio" name="tabs" id="tab5"><label for="tab5" class="tab">5</label>
<input type="radio" name="tabs" id="tab6"><label for="tab6" class="tab">6</label>
</div>
<div class="content"></div>
</section>
enter image description here
hello,I tried a little and made this one.I think this structure can be useful for you.
Code:
enter code here
<div class="container">
<div class="menu">
<button class="first">Start
</button>
<button class="numbers" id="btn-top-shadow">1
</button>
<button class="numbers">2
</button>
<button class="numbers">3
</button>
<button class="numbers">4
</button>
<button class="numbers">5
</button>
<button class="numbers">6
</button>
<button class="numbers">7
</button>
</div>
<div class="content">
</div>
</div>
body {
margin: 0;
}
.container {
display: flex;
width: 100%;
height: 100vh;
}
.first
{
transform: rotate(270deg) scale(4.5) ;
position: relative;
top:10%;
font-size: 4px;
}
.menu {
background: lightgray;
flex: 0.1;
display: flex;
flex-direction: column;
padding-left: 15px;
}
.numbers {
background: #79726c;
border: none;
transform: skewY(10deg);
width: 38%;
position: relative;
left: 38px;
top: 110px;
color: white;
text-shadow: 0px 7px 3px black;
height: 5%;
border-bottom: 0.4px solid black
}
#btn-top-shadow
{
box-shadow: 0px -7px 7px black;
}
.content {
flex: 1;
background: blue;
}
To achieve the shape you want on the first button. Use two buttons!
Assign the same scripts!
https://www.codegrepper.com/code-examples/css/css+triangle+button
Here's some details on how to make the triangle part!
Good luck!
I want my priority-menu (the one with 2 dots) to have the 3 dots displayed horizontally. Since each individual dot is inline-block I don't understand why they are stacked on top of one another. The menu is rendered by clicking on the blue circle on the right of the "save task" button, which changes its display to inline instead of none. I tried changing that to inline-block and nothing seems to have changed.
/* The popup menu - hidden by default */
#priority-menu {
display: none;
position: absolute;
top: 150%;
border: 3px solid #f1f1f1;
z-index: 9;
max-width: 300px;
padding: 10px;
background-color: white;
}
#priority-dot-open-menu {
position: relative;
height: 25px;
width: 25px;
background-color: blue;
border-radius: 50%;
display: inline-block;
opacity: 0.8;
cursor: pointer;
}
#priority-dot-open-menu:hover {
opacity: 1;
}
#priority-dot-blue {
height: 25px;
width: 25px;
background-color: blue;
border-radius: 50%;
display: inline-block;
opacity: 0.8;
}
#priority-dot-yellow {
height: 25px;
width: 25px;
background-color: yellow;
border-radius: 50%;
display: inline-block;
opacity: 0.8;
}
#priority-dot-red {
height: 25px;
width: 25px;
background-color: red;
border-radius: 50%;
display: inline-block;
opacity: 0.8;
}
.modal-footer {
padding: 0;
}
#priority-menu::after {
content: " ";
position: absolute;
bottom: 100%; /* At the top of the tooltip */
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent black transparent;
}
<div class="modal-footer d-flex flex-row justify-content-start pl-0 mt-4 border-0">
<button type="button" class="btn btn-primary btn-sm" id="add-task-modal-save">Save task</button>
<span id="priority-dot-open-menu">
<span id="priority-menu">
<span class="tooltip-top"></span>
<span id="priority-dot-blue"></span>
<span id="priority-dot-yellow"></span>
<span id="priority-dot-red"></span>
</span>
</span>
</div>
Your priority-menu is contained within an element which you’ve set to 25px width. Try removing this and changing to 300px, like your priority-menu.
#priority-dot-open-menu {
position: relative;
height: 25px
width: 300px;
background-color: blue;
border-radius: 50%;
display: inline-block;
opacity: 0.8;
cursor: pointer;
}
You can also try adding a declared width to your menu instead of just a max-width.
#priority-menu {
width:300px;
}
I want to make borders to be consistent throughout the pages. What do you think is the best method to do this? I have added an image below, I had in mind to have the red areas blank, cutting the menu borders and all the rest on the sides so it all looks aligned and centered. thanks a mil
https://jsfiddle.net/q97kob5b/
HTML
body {
font-family: verdana;
background: white;
color: black;
}
.menu_div {
background-color: #333;
width: 100%;
}
ul {
list-style-type: none;
margin: 0 auto;
display: table;
padding: 0;
z-index: 100;
overflow: hidden;
}
li {
float: left;
}
li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: black;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 100;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #f1f1f1
}
.dropdown:hover .dropdown-content {
display: block;
}
#keyframes fade {
0% {
opacity: 0;
}
11.11% {
opacity: 1;
}
33.33% {
opacity: 1;
}
44.44% {
opacity: 0;
}
100% {
opacity: 0;
}
}
.fadein {
position: absolute;
height: 102px;
width: 50px;
outline: 1px solid blue;
}
.fadein img {
position: absolute;
left: 0;
right: 0;
opacity: 0;
animation-name: fade;
animation-duration: 9s;
animation-iteration-count: infinite;
}
.fadein img:nth-child(1) {
animation-delay: 0s;
}
.fadein img:nth-child(2) {
animation-delay: 3s;
}
.fadein img:nth-child(3) {
animation-delay: 6s;
}
.menu_div {
position: relative;
z-index: 0;
border: dashed;
height: 2.9em;
margin-bottom: 0em;
margin-top: 0em;
z-index: 1000;
}
.fadein {
position: relative;
z-index: 3;
background:;
width: 100%;
left: 1px;
top: 0em;
}
.fadein img {
margin: 0 auto;
width: 100%;
max-width: 4060px;
min-width: 900px;
max-height: 500%;
}
.tech-slideshow {
height: 200px;
max-width: 800px;
margin: 0 auto;
position: relative;
overflow: hidden;
transform: translate3d(0, 0, 0);
}
.tech-slideshow > div {
height: 100px;
width: 2526px;
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/collage.jpg);
position: absolute;
top: 0;
left: 0;
height: 100%;
transform: translate3d(0, 0, 0);
}
.tech-slideshow .mover-1 {
animation: moveSlideshow 12s linear infinite;
}
.tech-slideshow .mover-2 {
opacity: 0;
transition: opacity 0.5s ease-out;
background-position: 0 -200px;
animation: moveSlideshow 15s linear infinite;
}
.tech-slideshow:hover .mover-2 {
opacity: 1;
}
#keyframes moveSlideshow {
100% {
transform: translateX(-66.6666%);
}
}
form {
background-color: #f7f7f7;
border: 2px solid black;
/* Just to center the form on the page */
margin: auto;
width: 1000px;
height: 500px;
/* To see the limits of the form */
padding: 7em;
border: 400px solid white;
border-radius: 10em;
}
div + div {
margin-top: 0.5em;
}
label {
/* To make sure that all label have the same size and are properly align */
display: inline-block;
width: 130px;
text-align: left;
}
input, textarea {
/* To make sure that all text field have the same font settings
By default, textarea are set with a monospace font */
font: 0.9em verdana;
/* To give the same size to all text field */
width: 300px;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* To harmonize the look & feel of text field border */
border: 1px solid;
}
input:focus, textarea:focus {
/* To give a little highligh on active elements */
border-color: #000;
}
textarea {
/* To properly align multiline text field with their label */
vertical-align: top
/* To give enough room to type some text */
height: 20em;
/* To allow users to resize any textarea vertically
It works only on Chrome, Firefox and Safari */
resize: vertical;
}
.button {
/* To position the buttons to the same position of the text fields */
padding-left: 400px; /* same size as the label elements */
}
button {
/* This extra magin represent the same space as the space between
the labels and their text fields */
margin-left: .4em;
}
<!DOCTYPE html>
<html>
<head>
<title>Bewerbungsformular</title>
<link rel="stylesheet" href="index.css" type="text/css" />
</head>
<body>
<h1 align="center"> <img src="logo.png" alt="A.Willi A.G" /> </h1>
<div class="menu_div">
<ul>
<li>Home</li>
<li class="dropdown"> Bewerber
<div class="dropdown-content"> Info Jobs </div>
</li>
<li class="dropdown">Kunde
<div class="dropdown-content"> Personalverleih Werkzeuge Mieten Referenzen Qulität, Sicherheit und Weiterbildung </div>
</li>
<li>Kontakt</li>
</ul>
</div>
<div class="fadein"> <img src="welder1.png"> <img src="welder2.png"> <img src="welder3.png"> </div>
<div class="fadein img"> </div>
<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi" method="post">
<div>
<h2>Bewerbungsformular</h2>
<label for="name">Vorname*</label>
<input type="text" id="name" name="user_name">
</div>
<div>
<label for="mail">Nachname*</label>
<input type="email" id="mail" name="user_email">
</div>
<div>
<label for="msg">E-Mail*</label>
<textarea id="msg" name="user_message"></textarea>
</div>
<div>
<label for="msg">Telefon*</label>
<textarea id="msg" name="user_message"></textarea>
</div>
<div>
<label for="msg">Nationalität*</label>
<textarea id="msg" name="user_message"></textarea>
</div>
<div>
<label for="msg">Alter*</label>
<textarea id="msg" name="user_message"></textarea>
</div>
<div>
<label for="msg">Beruf*</label>
<textarea id="msg" name="user_message"></textarea>
</div>
<div>
<form action="upload.php" method="post" enctype="multipart/form-data">
Lebenslauf oder Bewerbung und Beilagen*
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
</div>
<div class="button">
<button type="submit">Send your message</button>
</div>
</form>
</body>
</html>
The best way to do this would be to wrap your content within a container, and set the max-width for this (70%) or so, then if you want to add borders to this container you can do so.
Add <div class="container"> before any content you want to be centered/contained, then close the div at the end, and add the following to your css:
.container {
max-width: 70%;
margin-left: auto;
margin-right: auto;
}
Wrap your page inside a
<div id="wrapper">
your content here
</div>
/* add this to css */
#wrapper {
width:960px; /*put here the width you want*/
margin: 0 auto;
}
/*-----*/
I have a button which has a static and hover state.
Now there is a small down arrow image which sits after text using :before class. I had to use :before instead :after as there is a hover effect. Due to hover effect the :after class was not displaying the small arrow image so I had to use :before and absolute positioning to position that image after text.
The problem is that the text length can vary and as it is absolute position so sometimes the image sits inside the text not after the text.
Here is the code
<button type="submit" class="button uppercase btn-1b">home</button>
<br>
<br>
<button type="submit" class="button uppercase btn-1b">development</button>
Demo: Example of short and long text with image(small down arrow)
Any help is highly appreciated. Thanks in advance.
interchanged with :before :after
remove position: absolute; for arrow
.uppercase {
text-transform: uppercase;
}
.button {
color: white;
position: relative;
z-index: 1;
background: #000;
border: 1px solid #9d9368;
font-size: 17px;
padding: 0.5rem 2rem;
width: 220px;
display: inline-block;
cursor:pointer;
}
.button:after {
background-image: url("http://s12.postimg.org/63ise2fkp/button_arrow.png?noCache=1431762044");
background-repeat: no-repeat;
content:"";
height: 5px;
width: 8px;
margin-left: 5px;
display: inline-block;
vertical-align: middle;
}
.button:before {
content:"";
position: absolute;
top: 1.1rem;
right: 4.1rem;
transition: all 0.3s ease 0s;
z-index: -1;
}
.btn-1b:before {
width: 100%;
height: 0;
top: 0;
left: 0;
background: #b0a479;
}
.btn-1b:hover, .btn-1b:active {
color: #000000;
}
.btn-1b:hover:before, .btn-1b:active:before {
height: 100%;
}
.button:hover:after {
background-image: url("http://s8.postimg.org/419zt4xk1/button_arrow_hover.png?noCache=1431844698");
}
<button type="submit" class="button uppercase btn-1b">home</button>
<br>
<br>
<button type="submit" class="button uppercase btn-1b">development</button>
I'd suggest taking advantage of the fact that the <button> element can contain child elements, and wrapping the text with a <span>, then using the - more appropriate ::after pseudo-element:
<button type="submit" class="button uppercase btn-1b"><span>home</span>
</button>
<br>
<br>
<button type="submit" class="button uppercase btn-1b"><span>development</span>
</button>
And using the following CSS for the un-hovered and hovered states:
.button span:after {
background-image: url("http://s12.postimg.org/63ise2fkp/button_arrow.png?noCache=1431762044");
background-repeat: no-repeat;
content:"";
display: inline-block;
height: 5px;
width: 8px;
margin-left: 0.5em;
}
.button:hover span:after {
background-image: url("http://s8.postimg.org/419zt4xk1/button_arrow_hover.png?noCache=1431844698");
}
.button span:after {
background-image: url("http://s12.postimg.org/63ise2fkp/button_arrow.png?noCache=1431762044");
background-repeat: no-repeat;
content: "";
display: inline-block;
height: 5px;
width: 8px;
margin-left: 0.5em;
}
.button:after {
content: "";
position: absolute;
top: 1.1rem;
right: 4.1rem;
transition: all 0.3s ease 0s;
z-index: -1;
}
.uppercase {
text-transform: uppercase;
}
.button {
color: white;
position: relative;
z-index: 1;
background: #000;
border: 1px solid #9d9368;
font-size: 17px;
padding: 0.5rem 2rem;
width: 220px;
display: inline-block;
cursor: pointer;
}
.btn-1b:after {
width: 100%;
height: 0;
top: 0;
left: 0;
background: #b0a479;
}
.btn-1b:hover,
.btn-1b:active {
color: #000000;
}
.btn-1b:hover:after,
.btn-1b:active:after {
height: 100%;
}
.button:hover span:after {
background-image: url("http://s8.postimg.org/419zt4xk1/button_arrow_hover.png?noCache=1431844698");
}
<button type="submit" class="button uppercase btn-1b"><span>home</span>
</button>
<br>
<br>
<button type="submit" class="button uppercase btn-1b"><span>development</span>
</button>
JS Fiddle demo.