I'm using this piece of CSS to style a button.
Is there any way to also style text with it?
Without losing any of the effects?
The button I'm referring to: (#1)
https://webdeasy.de/en/top-css-buttons-en/
.drts-bs-btn-outline-primary {
width: 220px;
height: 50px;
border: none;
outline: none;
color: #fff;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.drts-bs-btn-outline-primary: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;
transition: opacity .3s ease-in-out;
border-radius: 10px;
}
.drts-bs-btn-outline-primary:active {
color: #000
}
.drts-bs-btn-outline-primary:active:after {
background: transparent;
}
.drts-bs-btn-outline-primary:after {
z-index: -1;
content: '';
position: absolute;
width: 100%;
height: 100%;
background: #111;
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% { background-position: 0 0; }
50% { background-position: 400% 0; }
100% { background-position: 0 0; }
}
<button class="drts-bs-btn-outline-primary" type="button">HOVER ME, THEN CLICK ME!</button>
Can't find a solution for this
One option could be to overwrite the default style using !important. Follow the link to learn more.
button {
font-size: 2em;
color: green!important;
}
.drts-bs-btn-outline-primary {
width: 220px;
height: 50px;
border: none;
outline: none;
color: #fff;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
}
.drts-bs-btn-outline-primary: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;
transition: opacity .3s ease-in-out;
border-radius: 10px;
}
.drts-bs-btn-outline-primary:active {
color: #000
}
.drts-bs-btn-outline-primary:active:after {
background: transparent;
}
.drts-bs-btn-outline-primary:after {
z-index: -1;
content: '';
position: absolute;
width: 100%;
height: 100%;
background: #111;
left: 0;
top: 0;
border-radius: 10px;
}
#keyframes glowing {
0% { background-position: 0 0; }
50% { background-position: 400% 0; }
100% { background-position: 0 0; }
}
<button class="drts-bs-btn-outline-primary" type="button">HOVER ME, THEN CLICK ME!</button>
Related
Can you help me?
Currently the red exit button is on the spinning fan, I want to place it below it.
How do I do that in the code? https://jsfiddle.net/aqpoew6d/
I am trying to do this:
Image
.exit {
position: absolute;
top: 200px;
bottom: -47.63px;
margin: auto;
right: 0;
left: 0;
width: 47px;
height: 47px;
cursor: pointer;
border-radius: 100%;
background: transparent;
border: 5px solid red;
box-sizing: border-box;
opacity: 1;
clip-path: circle(50%);
}
.exit::before,
.exit::after {
content: "";
background-color: red;
width: 47px;
height: 5px;
position: absolute;
top: 0px;
left: -5px;
right: 0;
bottom: 0;
margin: auto;
}
.exit::before {
transform: rotate(45deg);
}
.exit::after {
transform: rotate(-45deg);
}
Image
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background: gray;
}
.containerInitial {
position: absolute;
left: 0;
right: 0;
min-height: 100%;
min-width: 255px;
display: flex;
padding: 8px 8px;
}
.curtainInitial {
flex: 1 0 0;
margin: auto;
max-width: 680px;
border: 21px solid;
border-radius: 12px;
border-color: #000 #101010 #000 #101010;
position: relative;
overflow: hidden;
}
.curtainInitial::before {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
background: #0a0a0a;
background: radial-gradient(circle, transparent 0% 48.5%, #0a0a0a 48.5%);
border: 1px solid;
border-color: #000 #101010 #000 #101010;
}
.curtainInitial::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
outline: 1px solid green;
pointer-events: none;
}
.fence {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
background:
linear-gradient(45deg,
#0000 7px,
#0a0a0a 0 7.5px,
#0000 0 10px),
linear-gradient(-45deg,
#0000 7px,
#0a0a0a 0 7.5px,
#0000 0 10px),
linear-gradient(to top, #e10019 0%, #957e00 100%);
background-size: 10px 10px,10px 10px, cover;
filter: drop-shadow(0 0 5px #000);
-webkit-animation: fade 5s infinite;
animation: fade 5s infinite;
clip-path: circle(34.5% at center);
}
.fence>div {
position: absolute;
/*top: 0;*/
left: 0;
right: 0;
/*width: 100%;*/
height: 0.55%;
/*height: 2px;*/
background: black;
}
.fence>div:nth-child(1) {
top: 9.8%;
}
.fence>div:nth-child(2) {
top: 19.2%;
}
.fence>div:nth-child(3) {
top: 28.6%;
}
.fence>div:nth-child(4) {
top: 38%;
}
.fence>div:nth-child(5) {
top: 47.4%;
}
.fence>div:nth-child(6) {
top: 56.8%;
}
.fence>div:nth-child(7) {
top: 66.2%;
}
.fence>div:nth-child(8) {
top: 75.6%;
}
.fence>div:nth-child(9) {
top: 85%;
}
.fence>div:nth-child(10) {
top: 94.4%;
}
.fan svg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
margin: auto;
}
.cross {
clip-path: circle(34.5% at center);
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
background: transparent;
}
.cross::before,
.cross::after {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
background: black;
}
.cross::before
/*horizontal*/
{
height: 2.8%;
}
.cross::after
/*vertical*/
{
width: 1.4%;
}
.ratio-keeper {
position: relative;
height: 0;
padding-top: 56.25%;
margin: auto;
overflow: hidden;
}
.fan svg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
animation: fan-spin 40s infinite linear;
}
#keyframes fan-spin {
0% {
transform: scale(0.98) rotate(0deg);
}
100% {
transform: scale(0.98) rotate(360deg);
}
}
#-webkit-keyframes fade {
0% {
opacity: 0.9;
}
50% {
opacity: 1;
}
100% {
opacity: 0.9;
}
}
#keyframes fade {
0% {
opacity: 0.9;
}
50% {
opacity: 1;
}
100% {
opacity: 0.9;
}
}
iframe {
display: block;
animation: iframe 5s ease-in 5s forwards;
animation-delay: 1s;
opacity: 0;
}
#keyframes iframe {
to {
opacity: 1;
}
}
.embed-youtube iframe,
.embed-youtube .embed-youtube-play,
.embed-youtube .embed-youtube-play::before {
position: absolute;
}
.embed-youtube iframe {
height: 100%;
width: 100%;
top: 0;
left: 0;
}
.exit {
position: absolute;
top: 200px;
bottom: -47.63px;
margin: auto;
right: 0;
left: 0;
width: 47px;
height: 47px;
cursor: pointer;
border-radius: 100%;
background: transparent;
border: 5px solid red;
box-sizing: border-box;
opacity: 1;
clip-path: circle(50%);
}
.exit::before,
.exit::after {
content: "";
background-color: red;
width: 47px;
height: 5px;
position: absolute;
top: 0px;
left: -5px;
right: 0;
bottom: 0;
margin: auto;
}
.exit::before {
transform: rotate(45deg);
}
.exit::after {
transform: rotate(-45deg);
}
<div class="containerInitial ">
<div class="curtainInitial">
<div class="ratio-keeper">
<div class="fence">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="fan">
<svg xmlns="http://www.w3.org/2000/svg" width="70%" height="70%" viewBox="76 130 381 381">
<g id="fan">
<title>Fan</title>
<path fill="#000100" stroke="#000"
d="m166.3352 168.6294c5.5396 2.4448 45.2339 54.394 72.7499 91.0151-9.1901-44.8757-21.7959-109.0279-19.9558-114.796 4.1462-12.9949 33.7039-13.5172 41.5845-13.7579 7.8827-.2415 37.4165-1.5221 42.3488 11.1948 2.1872 5.6436-6.4773 70.4506-12.9142 115.8007 25.2309-38.2323 61.6818-92.5089 67.0612-95.2865 12.119-6.2568 33.3898 14.2749 39.1337 19.6768 5.7424 5.402 27.5341 25.3815 22.0294 37.859-2.4441 5.5389-54.3954 45.2354-91.0172 72.7506 44.8757-9.1901 109.0293-21.7959 114.7974-19.9559 12.9927 4.1442 13.5193 33.7032 13.7586 41.5838.2422 7.8819 1.5221 37.4165-11.192 42.3473-5.6471 2.1894-70.4541-6.4765-115.8049-12.9127 38.2323 25.2323 92.5081 61.6783 95.2871 67.0605 6.2581 12.1175-14.2742 33.3877-19.6776 39.133-5.4027 5.7432-25.3815 27.5341-37.8563 22.0279-5.5396-2.4434-45.2361-54.3961-72.7534-91.0143 9.1901 44.8757 21.7952 109.0287 19.9551 114.7953-4.1434 12.9934-33.7026 13.5157-41.5852 13.7586-7.8799.24-37.4165 1.5221-42.3431-11.1936-2.1887-5.6464 6.4779-70.4541 12.9133-115.8071-25.2323 38.2323-61.6824 92.5124-67.0639 95.2908-12.1169 6.256-33.3891-14.2728-39.1337-19.6754-5.7432-5.4027-27.5313-25.383-22.0251-37.8578 2.4434-5.5396 54.394-45.2339 91.0136-72.7526-44.8764 9.1908-109.0266 21.7944-114.7967 19.9566-12.9934-4.1434-13.5171-33.7025-13.7586-41.5852-.2407-7.8806-1.5221-37.4165 11.1963-42.346 5.6443-2.1879 70.4498 6.4752 115.8 12.9121-38.233-25.2316-92.5081-61.6783-95.2865-67.0612-6.256-12.1169 14.2748-33.3913 19.6768-39.1337 5.4006-5.7438 25.3794-27.5333 37.8584-22.0272z" />
</g>
</svg>
</div>
<div class="cross"></div>
<div class="wrap">
<div class="video video-frame" data-id="CHahce95B1g"></div>
</div>
<div class="video-one"></div>
</div>
<button class="exit" type="button" title="Exit" aria-label="Close"></button>
</div>
</div>
move button outside last div and change bottom on .exit to -257px
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background: gray;
}
.containerInitial {
position: absolute;
left: 0;
right: 0;
min-height: 100%;
min-width: 255px;
display: flex;
padding: 8px 8px;
}
.curtainInitial {
flex: 1 0 0;
margin: auto;
max-width: 680px;
border: 21px solid;
border-radius: 12px;
border-color: #000 #101010 #000 #101010;
position: relative;
overflow: hidden;
}
.curtainInitial::before {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
background: #0a0a0a;
background: radial-gradient(circle, transparent 0% 48.5%, #0a0a0a 48.5%);
border: 1px solid;
border-color: #000 #101010 #000 #101010;
}
.curtainInitial::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
outline: 1px solid green;
pointer-events: none;
}
.fence {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
background:
linear-gradient(45deg,
#0000 7px,
#0a0a0a 0 7.5px,
#0000 0 10px),
linear-gradient(-45deg,
#0000 7px,
#0a0a0a 0 7.5px,
#0000 0 10px),
linear-gradient(to top, #e10019 0%, #957e00 100%);
background-size: 10px 10px,10px 10px, cover;
filter: drop-shadow(0 0 5px #000);
-webkit-animation: fade 5s infinite;
animation: fade 5s infinite;
clip-path: circle(34.5% at center);
}
.fence>div {
position: absolute;
/*top: 0;*/
left: 0;
right: 0;
/*width: 100%;*/
height: 0.55%;
/*height: 2px;*/
background: black;
}
.fence>div:nth-child(1) {
top: 9.8%;
}
.fence>div:nth-child(2) {
top: 19.2%;
}
.fence>div:nth-child(3) {
top: 28.6%;
}
.fence>div:nth-child(4) {
top: 38%;
}
.fence>div:nth-child(5) {
top: 47.4%;
}
.fence>div:nth-child(6) {
top: 56.8%;
}
.fence>div:nth-child(7) {
top: 66.2%;
}
.fence>div:nth-child(8) {
top: 75.6%;
}
.fence>div:nth-child(9) {
top: 85%;
}
.fence>div:nth-child(10) {
top: 94.4%;
}
.fan svg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
margin: auto;
}
.cross {
clip-path: circle(34.5% at center);
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
background: transparent;
}
.cross::before,
.cross::after {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
background: black;
}
.cross::before
/*horizontal*/
{
height: 2.8%;
}
.cross::after
/*vertical*/
{
width: 1.4%;
}
.ratio-keeper {
position: relative;
height: 0;
padding-top: 56.25%;
margin: auto;
overflow: hidden;
}
.fan svg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 100%;
animation: fan-spin 40s infinite linear;
}
#keyframes fan-spin {
0% {
transform: scale(0.98) rotate(0deg);
}
100% {
transform: scale(0.98) rotate(360deg);
}
}
#-webkit-keyframes fade {
0% {
opacity: 0.9;
}
50% {
opacity: 1;
}
100% {
opacity: 0.9;
}
}
#keyframes fade {
0% {
opacity: 0.9;
}
50% {
opacity: 1;
}
100% {
opacity: 0.9;
}
}
iframe {
display: block;
animation: iframe 5s ease-in 5s forwards;
animation-delay: 1s;
opacity: 0;
}
#keyframes iframe {
to {
opacity: 1;
}
}
.embed-youtube iframe,
.embed-youtube .embed-youtube-play,
.embed-youtube .embed-youtube-play::before {
position: absolute;
}
.embed-youtube iframe {
height: 100%;
width: 100%;
top: 0;
left: 0;
}
.exit {
position: absolute;
top: 200px;
bottom: -275.63px;
margin: auto;
right: 0;
left: 0;
width: 47px;
height: 47px;
cursor: pointer;
border-radius: 100%;
background: transparent;
border: 5px solid red;
box-sizing: border-box;
opacity: 1;
clip-path: circle(50%);
}
.exit::before,
.exit::after {
content: "";
background-color: red;
width: 47px;
height: 5px;
position: absolute;
top: 0px;
left: -5px;
right: 0;
bottom: 0;
margin: auto;
}
.exit::before {
transform: rotate(45deg);
}
.exit::after {
transform: rotate(-45deg);
}
<div class="containerInitial ">
<div class="curtainInitial">
<div class="ratio-keeper">
<div class="fence">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="fan">
<svg xmlns="http://www.w3.org/2000/svg" width="70%" height="70%" viewBox="76 130 381 381">
<g id="fan">
<title>Fan</title>
<path fill="#000100" stroke="#000"
d="m166.3352 168.6294c5.5396 2.4448 45.2339 54.394 72.7499 91.0151-9.1901-44.8757-21.7959-109.0279-19.9558-114.796 4.1462-12.9949 33.7039-13.5172 41.5845-13.7579 7.8827-.2415 37.4165-1.5221 42.3488 11.1948 2.1872 5.6436-6.4773 70.4506-12.9142 115.8007 25.2309-38.2323 61.6818-92.5089 67.0612-95.2865 12.119-6.2568 33.3898 14.2749 39.1337 19.6768 5.7424 5.402 27.5341 25.3815 22.0294 37.859-2.4441 5.5389-54.3954 45.2354-91.0172 72.7506 44.8757-9.1901 109.0293-21.7959 114.7974-19.9559 12.9927 4.1442 13.5193 33.7032 13.7586 41.5838.2422 7.8819 1.5221 37.4165-11.192 42.3473-5.6471 2.1894-70.4541-6.4765-115.8049-12.9127 38.2323 25.2323 92.5081 61.6783 95.2871 67.0605 6.2581 12.1175-14.2742 33.3877-19.6776 39.133-5.4027 5.7432-25.3815 27.5341-37.8563 22.0279-5.5396-2.4434-45.2361-54.3961-72.7534-91.0143 9.1901 44.8757 21.7952 109.0287 19.9551 114.7953-4.1434 12.9934-33.7026 13.5157-41.5852 13.7586-7.8799.24-37.4165 1.5221-42.3431-11.1936-2.1887-5.6464 6.4779-70.4541 12.9133-115.8071-25.2323 38.2323-61.6824 92.5124-67.0639 95.2908-12.1169 6.256-33.3891-14.2728-39.1337-19.6754-5.7432-5.4027-27.5313-25.383-22.0251-37.8578 2.4434-5.5396 54.394-45.2339 91.0136-72.7526-44.8764 9.1908-109.0266 21.7944-114.7967 19.9566-12.9934-4.1434-13.5171-33.7025-13.7586-41.5852-.2407-7.8806-1.5221-37.4165 11.1963-42.346 5.6443-2.1879 70.4498 6.4752 115.8 12.9121-38.233-25.2316-92.5081-61.6783-95.2865-67.0612-6.256-12.1169 14.2748-33.3913 19.6768-39.1337 5.4006-5.7438 25.3794-27.5333 37.8584-22.0272z" />
</g>
</svg>
</div>
<div class="cross"></div>
<div class="wrap">
<div class="video video-frame" data-id="CHahce95B1g"></div>
</div>
<div class="video-one"></div>
</div>
</div>
</div>
<button class="exit" type="button" title="Exit" aria-label="Close"></button>
I am not able to run my code and produce an image under header 2
Are there any reason why as I have already input the right code.
I believe another css layout is blocking the image from popping out. Below here is the code to check
<div class="login-box">
<h2>Login</h2>
<form>
<div class="user-box">
<input type="text" name="" required="">
<label>Username</label>
</div>
<div class="user-box">
<input type="password" name="" required="">
<label>Password</label>
</div>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Submit
</a>
</form>
</div>
<div class="section-container">
<h2 class="title-container">Here are my other socials you can find me on
</h2>
<img src="//placekitten.com/150/150" alt="">Image
</div>
My CSS below
html {
height: 100%;
}
body {
margin:0;
padding:0;
font-family: sans-serif;
background: linear-gradient(#141e30, #243b55);
}
.login-box {
position: absolute;
top: 78%;
left: 50%;
width: 400px;
padding: 30px;
transform: translate(-50% , -50%);
background: rgba(0,0,0,.5);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0,0,0,.6);
border-radius: 20px;
}
.login-box h2 {
margin: 0 0 30px;
padding: 0;
color: #fff;
text-align: center;
}
.login-box .user-box {
position: relative;
}
.login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.login-box .user-box label {
position: absolute;
top:0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: .5s;
}
.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #03e9f4;
font-size: 12px;
}
.login-box form a {
position: relative;
display: inline-block;
padding: 10px 20px;
color: #03e9f4;
font-size: 16px;
text-decoration: none;
text-transform: uppercase;
overflow: hidden;
transition: .5s;
margin-top: 40px;
letter-spacing: 4px
}
.login-box a:hover {
background: #03e9f4;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px #03e9f4,
0 0 25px #03e9f4,
0 0 50px #03e9f4,
0 0 100px #03e9f4;
}
.login-box a span {
position: absolute;
display: block;
}
.login-box a span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #03e9f4);
animation: btn-anim1 1s linear infinite;
}
#keyframes btn-anim1 {
0% {
left: -100%;
}
50%,100% {
left: 100%;
}
}
.login-box a span:nth-child(2) {
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #03e9f4);
animation: btn-anim2 1s linear infinite;
animation-delay: .25s
}
#keyframes btn-anim2 {
0% {
top: -100%;
}
50%,100% {
top: 100%;
}
}
.login-box a span:nth-child(3) {
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #03e9f4);
animation: btn-anim3 1s linear infinite;
animation-delay: .5s
}
#keyframes btn-anim3 {
0% {
right: -100%;
}
50%,100% {
right: 100%;
}
}
.login-box a span:nth-child(4) {
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #03e9f4);
animation: btn-anim4 1s linear infinite;
animation-delay: .75s
}
#keyframes btn-anim4 {
0% {
bottom: -100%;
}
50%,100% {
bottom: 100%;
}
}
.section-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: left;
width: 100%;
background-image: linear-gradient( 60deg, rgba(57, 60, 90, 0.85), rgba(180, 180, 120, 0.5) );
background-position: center;
background-size: cover;
font-weight: bold;
text-shadow: rgb(56, 50, 50) 1px 1px
}
.title-container {
display: block;
color: white;
text-shadow: 2px 2px black;
width: 40%;
padding: 30px;
margin-bottom: 20%;
margin-right: 50px;
border-top: 1px black solid;
}
I tried to put the img code under . but did not get the image to pop up under the h2 tag
html {
height: 100%;
}
body {
margin:0;
padding:0;
font-family: sans-serif;
background: linear-gradient(#141e30, #243b55);
}
.login-box {
position: absolute;
top: 78%;
left: 50%;
width: 400px;
padding: 30px;
transform: translate(-50% , -50%);
background: rgba(0,0,0,.5);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0,0,0,.6);
border-radius: 20px;
}
.login-box h2 {
margin: 0 0 30px;
padding: 0;
color: #fff;
text-align: center;
}
.login-box .user-box {
position: relative;
}
.login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.login-box .user-box label {
position: absolute;
top:0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: .5s;
}
.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #03e9f4;
font-size: 12px;
}
.login-box form a {
position: relative;
display: inline-block;
padding: 10px 20px;
color: #03e9f4;
font-size: 16px;
text-decoration: none;
text-transform: uppercase;
overflow: hidden;
transition: .5s;
margin-top: 40px;
letter-spacing: 4px
}
.login-box a:hover {
background: #03e9f4;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px #03e9f4,
0 0 25px #03e9f4,
0 0 50px #03e9f4,
0 0 100px #03e9f4;
}
.login-box a span {
position: absolute;
display: block;
}
.login-box a span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #03e9f4);
animation: btn-anim1 1s linear infinite;
}
#keyframes btn-anim1 {
0% {
left: -100%;
}
50%,100% {
left: 100%;
}
}
.login-box a span:nth-child(2) {
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #03e9f4);
animation: btn-anim2 1s linear infinite;
animation-delay: .25s
}
#keyframes btn-anim2 {
0% {
top: -100%;
}
50%,100% {
top: 100%;
}
}
.login-box a span:nth-child(3) {
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #03e9f4);
animation: btn-anim3 1s linear infinite;
animation-delay: .5s
}
#keyframes btn-anim3 {
0% {
right: -100%;
}
50%,100% {
right: 100%;
}
}
.login-box a span:nth-child(4) {
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #03e9f4);
animation: btn-anim4 1s linear infinite;
animation-delay: .75s
}
#keyframes btn-anim4 {
0% {
bottom: -100%;
}
50%,100% {
bottom: 100%;
}
}
.section-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: left;
width: 100%;
background-image: linear-gradient( 60deg, rgba(57, 60, 90, 0.85), rgba(180, 180, 120, 0.5) );
background-position: center;
background-size: cover;
font-weight: bold;
text-shadow: rgb(56, 50, 50) 1px 1px
}
.title-container {
display: block;
color: white;
text-shadow: 2px 2px black;
width: 40%;
padding: 30px;
margin-bottom: 20%;
margin-right: 50px;
border-top: 1px black solid;
}
<div class="login-box">
<h2>Login</h2>
<form>
<div class="user-box">
<input type="text" name="" required="">
<label>Username</label>
</div>
<div class="user-box">
<input type="password" name="" required="">
<label>Password</label>
</div>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Submit
</a>
</form>
</div>
<div class="section-container">
<h2 class="title-container">Here are my other socials you can find me on
</h2>
<img src="https://placekitten.com/150/150" alt="">Image
</div>
Not a css issue. You don't have the correct path to the image. I've inserted the correct path.
The margin on the heading element is causing this.
Instead of adding the img element, consider adding the image as a background to another element...
CSS added:
body {
background: url("//placekitten.com/150/150");
background-repeat: no-repeat;
background-size: cover;
}
Below I have added it to the body, but this could be done to any element of your choosing really.
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background: linear-gradient(#141e30, #243b55);
}
.login-box {
position: absolute;
top: 78%;
left: 50%;
width: 400px;
padding: 30px;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, .5);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0, 0, 0, .6);
border-radius: 20px;
}
.login-box h2 {
margin: 0 0 30px;
padding: 0;
color: #fff;
text-align: center;
}
.login-box .user-box {
position: relative;
}
.login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.login-box .user-box label {
position: absolute;
top: 0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: .5s;
}
.login-box .user-box input:focus~label,
.login-box .user-box input:valid~label {
top: -20px;
left: 0;
color: #03e9f4;
font-size: 12px;
}
.login-box form a {
position: relative;
display: inline-block;
padding: 10px 20px;
color: #03e9f4;
font-size: 16px;
text-decoration: none;
text-transform: uppercase;
overflow: hidden;
transition: .5s;
margin-top: 40px;
letter-spacing: 4px
}
.login-box a:hover {
background: #03e9f4;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px #03e9f4, 0 0 25px #03e9f4, 0 0 50px #03e9f4, 0 0 100px #03e9f4;
}
.login-box a span {
position: absolute;
display: block;
}
.login-box a span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #03e9f4);
animation: btn-anim1 1s linear infinite;
}
#keyframes btn-anim1 {
0% {
left: -100%;
}
50%,
100% {
left: 100%;
}
}
.login-box a span:nth-child(2) {
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #03e9f4);
animation: btn-anim2 1s linear infinite;
animation-delay: .25s
}
#keyframes btn-anim2 {
0% {
top: -100%;
}
50%,
100% {
top: 100%;
}
}
.login-box a span:nth-child(3) {
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #03e9f4);
animation: btn-anim3 1s linear infinite;
animation-delay: .5s
}
#keyframes btn-anim3 {
0% {
right: -100%;
}
50%,
100% {
right: 100%;
}
}
.login-box a span:nth-child(4) {
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #03e9f4);
animation: btn-anim4 1s linear infinite;
animation-delay: .75s
}
#keyframes btn-anim4 {
0% {
bottom: -100%;
}
50%,
100% {
bottom: 100%;
}
}
.section-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: left;
width: 100%;
background-image: linear-gradient( 60deg, rgba(57, 60, 90, 0.85), rgba(180, 180, 120, 0.5));
background-position: center;
background-size: cover;
font-weight: bold;
text-shadow: rgb(56, 50, 50) 1px 1px
}
.title-container {
display: block;
color: white;
text-shadow: 2px 2px black;
width: 40%;
padding: 30px;
margin-bottom: 20%;
margin-right: 50px;
border-top: 1px black solid;
}
body {
background: url("//placekitten.com/150/150");
background-repeat: no-repeat;
background-size: cover;
}
<div class="login-box">
<h2>Login</h2>
<form>
<div class="user-box">
<input type="text" name="" required="">
<label>Username</label>
</div>
<div class="user-box">
<input type="password" name="" required="">
<label>Password</label>
</div>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span> Submit
</a>
</form>
</div>
<div class="section-container">
<h2 class="title-container">Here are my other socials you can find me on
</h2>
</div>
I have working code for a CSS preloader at CSS preloader sample
I would like the animated preloader to be colored. I tried adding the style color: red !important; to various styles to the CSS class lds-ripple, but it did nothing.
A colored preloader would look more impressive in my view.
How would I make the CSS preloader show with colored rings?
the same code from working sample is also pasted below.
<button id="btnShow" onclick="showLoader()">Show Loader</button>
<div id="loader">
<div class="lds-ripple"><div></div><div></div></div>
</div>
<style>
#loader {
display: none;
justify-content: center;
align-items: center;
width:100%;
height:100%;
border:green solid 1 px;
opacity:0.9;
background-color:whitesmoke;
position:absolute;
left:0;
top:0;
}
.lds-ripple {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ripple div {
position: absolute;
border: 4px solid #fff;
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
animation-delay: -0.5s;
}
#keyframes lds-ripple {
0% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}
4.9% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}
5% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
}
100% {
top: 0px;
left: 0px;
width: 72px;
height: 72px;
opacity: 0;
}
}
</style>
<script>
function showLoader() {
document.getElementById("loader").style.display = "flex";
}
</script>
#fff in the line marked below can be changed to set the loader's color.
.lds-ripple div {
position: absolute;
border: 4px solid #fff; /* edit this line */
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
For example:
function showLoader() {
document.getElementById("loader").style.display = "flex";
}
showLoader();
#loader {
display: none;
justify-content: center;
align-items: center;
width:100%;
height:100%;
border:green solid 1 px;
opacity:0.9;
background-color:whitesmoke;
position:absolute;
left:0;
top:0;
}
.lds-ripple {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ripple div {
position: absolute;
border: 4px solid red;
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
animation-delay: -0.5s;
}
#keyframes lds-ripple {
0% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}
4.9% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}
5% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
}
100% {
top: 0px;
left: 0px;
width: 72px;
height: 72px;
opacity: 0;
}
}
<div id="loader">
<div class="lds-ripple"><div></div><div></div></div>
</div>
For changing color animation:
#keyframes lds-ripple {
0% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
border-color: red;
}
4.9% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
border-color: red;
}
5% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
border-color: red;
}
100% {
top: 0px;
left: 0px;
width: 72px;
height: 72px;
opacity: 0;
border-color: blue;
}
}
The problem is that the divs inside the lds-ripple have no dimension into it. So the color property won't have any effect. However, the border-color will still work. So you can replace the default #fff color with something like red. For example:
.lds-ripple div {
position: absolute;
border: 4px solid red; /* HERE */
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
function showLoader() {
document.getElementById("loader").style.display = "flex";
}
#loader {
display: none;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
border: green solid 1 px;
opacity: 0.9;
background-color: whitesmoke;
position: absolute;
left: 0;
top: 0;
}
.lds-ripple {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ripple div {
position: absolute;
border: 4px solid red; /* HERE */
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
animation-delay: -0.5s;
}
#keyframes lds-ripple {
0% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
border-color: red;
}
4.9% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
border-color: red;
}
5% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
border-color: red;
}
100% {
top: 0px;
left: 0px;
width: 72px;
height: 72px;
opacity: 0;
border-color: blue;
}
}
<button id="btnShow" onclick="showLoader()">Show Loader</button>
<div id="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
I have an animation which I want to play infinitely to catch the users attention.
It looks like this:
http://codepen.io/anon/pen/evdqeq
What I want to achieve is, that when the corner of the "paper" is folded, it will be paused for like 3 seconds. Then the paper corner should go back. Before restarting the animation I want a 5 second delay.
I have looked up for more information about css animations but there is nothing which really fits my needs.
Do I need to switch to JavaScript?
HTML
<div id="fpc_effect-back">
<div id="fpc_box">
<div id="fpc_content">
<img src="http://www.amboss-grimma.de/wp-content/uploads/2016/12/Katalog_Amboss.png">
</div>
<div id="fpc_corner-box">
<a id="fpc_page-tip" href="#">
<div id="fpc_corner-contents">
<div id="fpc_corner-button"><strong> </strong></div><div></a>
</div>
</div>
</div>
CSS
#fpc_effect-back {
background-color: #eeeef4;
width: 0;
font: 12pt arial,sans-serif,helvetica,verdana;
color: #666;
}
#fpc_effect-back * {
box-sizing: border-box;
}
#fpc_box {
width: 197px;
position: relative;
background-color: #FFF;
}
#fpc_content {
padding: 0px;
}
#fpc_content:before {
content:"";
width: 80px;
height: 0px;
float: right;
}
#fpc_page-tip:before, #fpc_page-tip:after {
background-color: #FFF;
position: absolute;
display: block;
z-index: 2;
border-top-right-radius: 60%;
width: 50%;
height: 50%;
content: "";
}
#fpc_page-tip:before {
right: 100%;
top: 0%;
background: -webkit-radial-gradient(-180% 200%, circle, rgba(255,255,255,0) 80%, rgba(0,0,0,.2) 100%);
}
#fpc_box:hover #fpc_page-tip:before {
border-right: solid 1px #fff;
}
#fpc_box div#fpc_corner-box:hover #fpc_page-tip:before {
border-right: solid 2px #fff;
}
#fpc_page-tip:after {
top: 100%;
right: 0%;
background: -webkit-radial-gradient(-250% 320%, circle, rgba(255,255,255,0) 80%, rgba(0,0,0,.2) 100%);
}
#fpc_box:hover #fpc_page-tip:after {
border-top: solid 1px #fff;
}
#fpc_box div#fpc_corner-box:hover #fpc_page-tip:after {
border-top: solid 2px #fff;
}
#fpc_corner-box {
height: 20px;
width: 20px;
right: 0;
top: 0;
position: absolute;
overflow: visible;
animation-name: paper-corner;
animation-duration: 2s;
animation-iteration-count: infinite;
}
#fpc_box:hover #fpc_corner-box {
height: 65px;
width: 65px;
}
#fpc_box div#fpc_corner-box:hover {
}
#fpc_corner-box:before {
position: absolute;
top: 0;
right: 0;
content: "";
display: block;
width: 133%;
height: 133%;
}
#fpc_corner-contents:after {
position: absolute;
top: 0;
right: 0;
content: "";
background: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0) 37%, #DDD 62%, rgba(230, 230, 230, 0.1) 64%, rgba(255, 255, 255, 0) 67%), -webkit-radial-gradient(-50% 150%, circle, transparent 74%, rgba(0, 0, 0, 0.2) 74%, transparent 81%);
display: block;
width: 133%;
height: 133%;
}
#fpc_page-tip {
position: absolute;
top: 0;
right: 0;
content: "";
background: -webkit-linear-gradient(45deg, #ddd 17%, #dfdfdf 18%, #f5f5f5 30%, #f8f8f8 34%, #eee 39%, rgba(200,200,200,0) 41%);
display: block;
width: 100%;
height: 100%;
}
#fpc_corner-button {
position: absolute;
width: 7em;
top: 0;
right: 0;
background-color: none;
color: #fff;
font-family: Verdana, Geneva, sans-serif;
text-align: center;
padding: 8px 5px;
border-radius: 0px;
display: inline-block;
font-size: 11px;
}
#fpc_corner-contents {
width: 125%;
position: absolute;
display: block;
overflow: hidden;
-webkit-mask: -webkit-linear-gradient(45deg, transparent 49%, #000 53%);
top: 0;
right: 0;
height: 125%;
}
#fpc_corner-contents:before {
content: "";
position: absolute;
top: 0;
right: 0;
content: "";
display: block;
width: 100%;
height: 100%;
background-color: white; /* Match this background color to #fpc_effect-back */
}
#fpc_corner-box, #fpc_corner-contents, #fpc_page-tip {
-webkit-transition-property: all;
-webkit-transition-duration: .3s;
-webkit-transition-timing-function: cubic-bezier(0, 0.35, .5, 1.7);
}
#fpc_corner-button strong {
font-size: 13px;
font-weight: bold;
display: block;
}
#keyframe paper-corner{
from {height: 20px; width: 20px;}
to {height: 65px; width: 65px;}
}
#-moz-keyframes paper-corner {
from {
height:20px;
width:20px
}
to {
height:65px;
width:65px;
}
}
#-webkit-keyframes paper-corner {
from {
height:20px;
width:20px
}
to {
height:65px;
width:65px;
}
}
#keyframes paper-corner {
from {
height:20px;
width:20px
}
to {
height:65px;
width:65px;
}
}
to get the 5 second delay you need to add animation-delay:5s; to #fpc_corner-box or you can set the animation-duration: 8s;
and for the pause you can somehow achieve it using % in the animation like so:
#keyframes paper-corner {
0% {
height:20px;
width:20px
}
50% {
height:20px;
width:20px
}
60% {
height:65px;
width:65px;
}
90% {
height:65px;
width:65px;
}
100% {
height:20px;
width:20px;
}
}
Codepen demo
As i understand you can use `
setTimeout(function(){
$('#fpc_corner-box').css('animation','paper-corner 2s 1');
}, 5000); // 5000 in ms so it is 5 seconds
`
Put a longer animation-duration and add more keyframes. 0% and 100% are assumed. so it's not necessary to define them.
#fpc_corner-box {
height: 20px;
width: 20px;
right: 0;
top: 0;
position: absolute;
overflow: visible;
animation-name: paper-corner;
animation-duration: 10s; /**/
animation-iteration-count: infinite;
}
#keyframes paper-corner {
10% {
height: 65px;
width: 65px;
}
40% {
height: 65px;
width: 65px;
}
50% {
height: 20px;
width: 20px;
}
}
when the corner of the "paper" is folded, it will be paused for like 3
seconds. Then the paper corner should go back. Before restarting the
animation I want a 5 second delay.
So in total you have 3 + 5 = 8 i.e. an 8-second animation.
Easiest way would be to divide your entire animation into these 8 parts. For convenience sake, let's say 10-second animation.
First, make the animation-duration: 10s; i.e. the entire length.
Next, divide 100 by 10 and you get 10% intervals.
Now, you want a 3-second delay while starting. So, that means from 0% to 30% there is no animation. Where each 10% denotes a 1s (we divided into these chunks above). So no change in height/width.
So, your key-frames would look like this:
#keyframes paper-corner {
0% { height: 0px; width: 0px; }
30% { height: 0px; width: 0px; }
}
Next, you want end of the animation to stay for 5 seconds. Apply the same mechanism, but this time from the end. So, starting from 100% stepping 10% for each 1-second, you reach to 50% for 5-seconds. This means from 50% to 100% there is no change with width/height which is the end size.
So, your key-frames would now look like this:
#keyframes paper-corner {
0% { height: 0px; width: 0px; }
30% { height: 0px; width: 0px; }
50% { height: 65px; width: 65px; }
100% { height: 65px; width: 65px; }
}
Putting it all together in a Fiddle: https://jsfiddle.net/abhitalks/ntgtaber/
Snippet:
#fpc_effect-back {
background-color: #eeeef4;
width: 0;
font: 12pt arial, sans-serif, helvetica, verdana;
color: #666;
}
#fpc_effect-back * {
box-sizing: border-box;
}
#fpc_box {
width: 197px;
position: relative;
background-color: #FFF;
}
#fpc_content {
padding: 0px;
}
#fpc_content:before {
content: "";
width: 80px;
height: 0px;
float: right;
}
#fpc_page-tip:before,
#fpc_page-tip:after {
background-color: #FFF;
position: absolute;
display: block;
z-index: 2;
border-top-right-radius: 60%;
width: 50%;
height: 50%;
content: "";
}
#fpc_page-tip:before {
right: 100%;
top: 0%;
background: -webkit-radial-gradient(-180% 200%, circle, rgba(255, 255, 255, 0) 80%, rgba(0, 0, 0, .2) 100%);
}
#fpc_box:hover #fpc_page-tip:before {
border-right: solid 1px #fff;
}
#fpc_box div#fpc_corner-box:hover #fpc_page-tip:before {
border-right: solid 2px #fff;
}
#fpc_page-tip:after {
top: 100%;
right: 0%;
background: -webkit-radial-gradient(-250% 320%, circle, rgba(255, 255, 255, 0) 80%, rgba(0, 0, 0, .2) 100%);
}
#fpc_box:hover #fpc_page-tip:after {
border-top: solid 1px #fff;
}
#fpc_box div#fpc_corner-box:hover #fpc_page-tip:after {
border-top: solid 2px #fff;
}
#fpc_corner-box {
height: 20px;
width: 20px;
right: 0;
top: 0;
position: absolute;
overflow: visible;
animation-name: paper-corner;
animation-duration: 10s;
animation-iteration-count: infinite;
}
#fpc_box:hover #fpc_corner-box {
height: 65px;
width: 65px;
}
#fpc_box div#fpc_corner-box:hover {}
#fpc_corner-box:before {
position: absolute;
top: 0;
right: 0;
content: "";
display: block;
width: 133%;
height: 133%;
}
#fpc_corner-contents:after {
position: absolute;
top: 0;
right: 0;
content: "";
background: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0) 37%, #DDD 62%, rgba(230, 230, 230, 0.1) 64%, rgba(255, 255, 255, 0) 67%), -webkit-radial-gradient(-50% 150%, circle, transparent 74%, rgba(0, 0, 0, 0.2) 74%, transparent 81%);
display: block;
width: 133%;
height: 133%;
}
#fpc_page-tip {
position: absolute;
top: 0;
right: 0;
content: "";
background: -webkit-linear-gradient(45deg, #ddd 17%, #dfdfdf 18%, #f5f5f5 30%, #f8f8f8 34%, #eee 39%, rgba(200, 200, 200, 0) 41%);
display: block;
width: 100%;
height: 100%;
}
#fpc_corner-button {
position: absolute;
width: 7em;
top: 0;
right: 0;
background-color: none;
color: #fff;
font-family: Verdana, Geneva, sans-serif;
text-align: center;
padding: 8px 5px;
border-radius: 0px;
display: inline-block;
font-size: 11px;
}
#fpc_corner-contents {
width: 125%;
position: absolute;
display: block;
overflow: hidden;
-webkit-mask: -webkit-linear-gradient(45deg, transparent 49%, #000 53%);
top: 0;
right: 0;
height: 125%;
}
#fpc_corner-contents:before {
content: "";
position: absolute;
top: 0;
right: 0;
content: "";
display: block;
width: 100%;
height: 100%;
background-color: white;
/* Match this background color to #fpc_effect-back */
}
#fpc_corner-box,
#fpc_corner-contents,
#fpc_page-tip {
-webkit-transition-property: all;
-webkit-transition-duration: .3s;
-webkit-transition-timing-function: cubic-bezier(0, 0.35, .5, 1.7);
}
#fpc_corner-button strong {
font-size: 13px;
font-weight: bold;
display: block;
}
#keyframes paper-corner {
0% { height: 0px; width: 0px; }
30% { height: 0px; width: 0px; }
50% { height: 65px; width: 65px; }
100% { height: 65px; width: 65px; }
}
<div id="fpc_effect-back">
<div id="fpc_box">
<div id="fpc_content">
<img src="http://www.amboss-grimma.de/wp-content/uploads/2016/12/Katalog_Amboss.png" />
</div>
<div id="fpc_corner-box">
<a id="fpc_page-tip" href="#">
<div id="fpc_corner-contents">
<div id="fpc_corner-button"></div>
</div>
</a>
</div>
</div>
</div>
Fiddle: https://jsfiddle.net/0qqnvrdg/
HTML:
<div class="loading"></div>
CSS:
body {
background: #0d8aa5;
}
.loading {
position: absolute;
left: 50%;
top: 25%;
/*margin: -60px 0 0 -60px;*/
background: #fff;
width: 200px;
height: 200px;
border-radius: 100%;
border: 10px solid #19bee1;
}
.loading:after {
content: '';
background: trasparent;
width: 140%;
height: 140%;
position: absolute;
border-radius: 100%;
top: -20%;
left: -20%;
opacity: 0.7;
box-shadow: rgba(255, 255, 255, 0.6) -4px -5px 3px -3px;
animation: rotate 2s infinite linear;
}
#keyframes rotate {
0% {
transform: rotateZ(0deg);
}
100% {
transform: rotateZ(360deg);
}
}
.loading:before {
background-image: url('http://i.stack.imgur.com/UTnLP.png');
background-size: 100%;
background-repeat: no-repeat;
display: block;
width: 85%;
height: 85%;
content:"";
position: absolute;
top: 20%;
left: 10%;
}
How can I modify the CSS to that the image is under the thin blue border while being on top of the white.
Is that possible?
added z-index: -1000; for under.
ps: nice effect for scrollbar )
body {
background: #0d8aa5;
}
.loading {
position: absolute;
left: 50%;
top: 25%;
/*margin: -60px 0 0 -60px;*/
background: transparent;
width: 200px;
height: 200px;
border-radius: 100%;
border: 10px solid #19bee1;
}
.loading:after {
content: '';
background: trasparent;
width: 140%;
height: 140%;
position: absolute;
border-radius: 100%;
top: -20%;
left: -20%;
opacity: 0.7;
box-shadow: rgba(255, 255, 255, 0.6) -4px -5px 3px -3px;
animation: rotate 2s infinite linear;
}
#keyframes rotate {
0% {
transform: rotateZ(0deg);
}
100% {
transform: rotateZ(360deg);
}
}
.loading:before {
background-image: url('http://i.stack.imgur.com/UTnLP.png');
background-size: cover;
background-repeat: no-repeat;
display: block;
width: 100%;
height: 100%;
content: "";
position: absolute;
border-radius: 50%;
z-index: -1000;
}
<div class="loading"></div>
.loading {overflow: hidden} - just add this line
It is Because You are adding Background image before div.loading that makes images as content.Instead add background image to div.