I am relatively new to programming (starting learning web dev less than 3 months ago), however already attempting to create a pretty complex (at least to me) progress bar.
I need this progress bar to not only change colors while the bar automatically moves from left to right as soon as the page loads - I've seen explanations all over the internet on how to do those.
However, once it is done, I need the colors for each portion (say, each 10%) to remain the same. So for example if the first 10% are a light red, the next 10% a darker red, etc... it first automatically goes through them as it animates, but then remains static with the different colors still seen and not just one last solid color.
The only way that I have found to do this so far is to create many different bars, each having a different z-index, however I am well aware this is very convoluted and probably not the most efficient way to implement this.
Like I said I am new to this so please be gentle :) I will show my code beneath. If anyone has a better suggestion, how I can have the different color separations within the same bar I would love to learn something new!
Thanks!
HTML:
<div class="meter">
<span id="rd1" style="width: 5%"><p></p></span>
<span id="rd2" style="width: 10%"><p></p></span>
<span id="rd3" style="width: 15%"><p></p></span>
<span id="rd4" style="width: 20%"><p></p></span>
<span id="rd5" style="width: 25%"><p></p></span>
<span id="rd6" style="width: 30%"><p></p></span>
<span id="rd7" style="width: 35%"><p></p></span>
<span id="rd8" style="width: 40%"><p></p></span>
<span id="rd9" style="width: 45%"><p></p></span>
<span id="rd10" style="width: 50%"><p></p></span>
<span id="rd11" style="width: 55%"><p></p></span>
<span id="rd12" style="width: 60%"><p></p></span>
<span id="rd13" style="width: 65%"><p></p></span>
<span id="rd14" style="width: 70%"><p></p></span>
<span id="rd15" style="width: 75%"><p></p></span>
<span id="rd16" style="width: 80%"><p></p></span>
<span id="rd17" style="width: 85%"><p></p></span>
<span id="rd18" style="width: 90%"><p></p></span>
<span id="rd19" style="width: 95%"><p></p></span>
<span id="rd20" style="width: 100%"><p></p></span>
</div>
CSS:
`#keyframes color{
0% {
background-color: hsl(315, 100%, 75%);
width: 5%;
}
5% {
background-color: hsl(315, 100%, 70%);
width: 10%;
}
10% {
background-color: hsl(315, 100%, 65%);
width:15%;
}
15% {
background-color: hsl(315, 100%, 60%);
width: 20%;
}
20% {
background-color: hsl(315, 100%, 55%);
width: 25%;
}
25% {
background-color: hsl(315, 100%, 50%);
width: 30%;
}
30% {
background-color: hsl(320, 100%, 50%);
width:35%;
}
35% {
background-color: hsl(325, 100%, 50%);
width: 40%;
}
40% {
background-color: hsl(330, 100%, 50%);
width: 45%;
}
45% {
background-color: hsl(335, 100%, 50%);
width: 50%;
}
50% {
background-color: hsl(340, 100%, 50%);
width:55%;
}
55% {
background-color: hsl(345, 100%, 50%);
width: 60%;
}
60% {
background-color: hsl(350, 100%, 50%);
width: 65%;
}
65% {
background-color: hsl(355, 100%, 50%);
width: 70%;
}
70% {
background-color: hsl(360, 100%, 50%);
width:75%;
}
75% {
background-color: hsl(360, 95%, 50%);
width: 80%;
}
80% {
background-color: hsl(360, 90%, 50%);
width: 85%;
}
85% {
background-color: hsl(360, 85%, 50%);
width: 90%;
}
90% {
background-color: hsl(360, 80%, 50%);
width:95%;
}
95% {
background-color: hsl(360, 75%, 50%);
width: 100%;
}
}
.meter {
height: 20px;
position: relative;
top: 100px;
background: grey;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
padding: 10px;
box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3);
}
#rd1 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(315, 100%, 75%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 4px;
overflow: hidden;
z-index: 20;
animation: color 4s linear 0s alternate;
}
#rd2 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(315, 100%, 70%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 32px;
overflow: hidden;
z-index: 19;
animation: color 4s linear 0s alternate;
}
#rd3 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(315, 100%, 65%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 60px;
overflow: hidden;
z-index: 18;
animation: color 4s linear 0s alternate;
}
#rd4 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(315, 100%, 60%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 88px;
overflow: hidden;
z-index: 17;
animation: color 4s linear 0s alternate;
}
#rd5 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(315, 100%, 55%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 116px;
overflow: hidden;
z-index: 16;
animation: color 4s linear 0s alternate;
}
#rd6 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(315, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 144px;
overflow: hidden;
z-index: 15;
animation: color 4s linear 0s alternate;
}
#rd7 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(320, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 172px;
overflow: hidden;
z-index: 14;
animation: color 4s linear 0s alternate;
}
#rd8 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(325, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 200px;
overflow: hidden;
z-index: 13;
animation: color 4s linear 0s alternate;
}
#rd9 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(330, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 228px;
overflow: hidden;
z-index: 12;
animation: color 4s linear 0s alternate;
}
#rd10 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(335, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 256px;
overflow: hidden;
z-index: 11;
animation: color 4s linear 0s alternate;
}
#rd11 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(340, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 284px;
overflow: hidden;
z-index: 10;
animation: color 4s linear 0s alternate;
}
#rd12 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(345, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 312px;
overflow: hidden;
z-index: 9;
animation: color 4s linear 0s alternate;
}
#rd13 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(350, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 340px;
overflow: hidden;
z-index: 8;
animation: color 4s linear 0s alternate;
}
#rd14 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(355, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 368px;
overflow: hidden;
z-index: 7;
animation: color 4s linear 0s alternate;
}
#rd15 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(360, 100%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 396px;
overflow: hidden;
z-index: 6;
animation: color 4s linear 0s alternate;
}
#rd16 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(360, 95%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 424px;
overflow: hidden;
z-index: 5;
animation: color 4s linear 0s alternate;
}
#rd17 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(360, 90%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 452px;
overflow: hidden;
z-index: 4;
animation: color 4s linear 0s alternate;
}
#rd18 {
display: block;
height: 140%;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(360, 85%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 480px;
overflow: hidden;
z-index: 3;
animation: color 4s linear 0s alternate;
}
#rd19 {
display: block;
height: 140%;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(360, 80%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 508px;
overflow: hidden;
z-index: 2;
animation: color 4s linear 0s alternate;
}
#rd20 {
display: block;
height: 140%;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: hsl(360, 75%, 50%);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 0px 0px rgba(255,255,255,0.1),
inset 0 -6px 6px rgba(0,0,0,0.4);
position: relative;
bottom: 536px;
overflow: hidden;
z-index: 1;
animation: color 4s linear 0s alternate;
}
#-webkit-keyframes move {
0% {background-position: 0px 0px, 0 0, 0 0}
100% {background-position: -100px 0px, 0 0, 0 0}
}
Related
Is there any way to made the same style like in the image with CSS?
HTML5 allows us to draw multiple background images on any element. We can use CSS3's linear-gradient() and repeating-linear-gradient() functions to create 2 background images and draw them on the respective element.
Following code will create the background you need:
#header {
background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.15),
rgba(255,255,255,0.15) 15px,
transparent 15px,
transparent 25px),
linear-gradient(to bottom, brown, red);
}
Note: Order of images in background-image property is important. Swapping
them won't create the effect you need.
Output Image:
Working Demo:
#header {
background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.15), rgba(255,255,255,0.15) 15px, transparent 15px, transparent 25px), linear-gradient(to bottom, brown, red);
height: 80px;
border-radius: 5px 5px 0 0;
}
<header id="header"></header>
Try the below CSS
<div class="meter red">
<span style="width: 25%"></span>
</div>
.meter {
height: 20px; /* Can be anything */
position: relative;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3);
}
.meter > span {
display: block;
height: 100%;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: rgb(43,194,83);
background-image: linear-gradient(
center bottom,
rgb(43,194,83) 37%,
rgb(84,240,84) 69%
);
box-shadow:
inset 0 2px 9px rgba(255,255,255,0.3),
inset 0 -2px 6px rgba(0,0,0,0.4);
position: relative;
overflow: hidden;
}
.red > span {
background-color: #f0a3a3;
background-image: linear-gradient(to bottom, #f0a3a3, #f42323);
}
.meter > span:after {
content: "";
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
background-image: linear-gradient(
-45deg,
rgba(255, 255, 255, .2) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, .2) 50%,
rgba(255, 255, 255, .2) 75%,
transparent 75%,
transparent
);
z-index: 1;
background-size: 50px 50px;
animation: move 2s linear infinite;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
overflow: hidden;
}
I am trying to create this image with css and html but m kept failing to get perfect curve and shadow as shown in image.
HTML
<div class="mainDiv">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>
CSS
.mainDiv{
position: relative;
width: 206px;
height: 190px;
margin: 0px auto;
margin-top:100px;
}
.square{
width:100px;
height:100px;
background:#df1c40;
float:left;
transform: skew(180deg,210deg);
position: absolute;
top: 42px;
}
.square2{
width:100px;
height:100px;
background:#ff9c28;
float:left;
transform: skew(180deg,150deg);
position: absolute;
left:100px;
top: 42px;
}
.square3{
width:117px;
height:100px;
background:#97bbdd;
float:left;
transform: rotate(150deg) translate(-40px, -16px) skew(30deg, 0deg);
position: absolute;
left: -1px;
top: -31px;
}
.square3:before {
content: "";
position: absolute;
top: 0%;
right: 0%;
width: 0px;
height: 0px;
border-bottom: 70px solid #28a55c;
border-left: 70px solid transparent;
-webkit-box-shadow: 5px 0px 0px -1px #879fd1;
-moz-box-shadow: 5px 0px 0px -1px #879fd1;
box-shadow: 5px 0px 0px -1px #879fd1;
transform: rotate(90deg);
}
.square3:after {
content: "";
position: absolute;
top: 0%;
right: 0%;
width: 0px;
height: 0px;
border-top: 70px solid #F3F5F6;
border-right: 70px solid transparent;
transform: rotate(90deg);
}
My best try. I am just doing this for my knowledge and any help with little bit detail will be appreciate.. :)
The curved areas in the top can be achieved to some extent using radial-gradient for background instead of using the border method to create the triangles.
This works in Chrome (v51.0.2704.7 dev-m), Opera (v36.0), Firefox (v45.0.2), Edge and IE11. It also works in Safari (tested on iPhone).
.mainDiv {
position: relative;
width: 206px;
height: 190px;
margin: 0px auto;
margin-top: 100px;
}
.square {
width: 100px;
height: 100px;
background: #df1c40;
float: left;
transform: skew(180deg, 210deg);
position: absolute;
top: 42px;
}
.square2 {
width: 100px;
height: 100px;
background: #ff9c28;
float: left;
transform: skew(180deg, 150deg);
position: absolute;
left: 100px;
top: 42px;
}
.square3 {
width: 117px;
height: 100px;
background: #97bbdd;
float: left;
transform: rotate(150deg) translate(-40px, -16px) skew(30deg, 0deg);
position: absolute;
left: -1px;
top: -31px;
overflow: hidden;
}
.square3:before {
content: "";
position: absolute;
top: 0%;
right: 0%;
width: 70px;
height: 70px;
padding: 0px 8px 0px 0px;
background: radial-gradient(ellipse 100px 35px at 45% 110%, #97bbdd 50%, rgb(40, 165, 92) 52%, rgb(40, 165, 92) 55%, transparent 56%);
background-size: 90% 100%;
background-repeat: no-repeat;
transform: rotate(90deg);
}
.square3:after {
content: "";
position: absolute;
top: 0%;
right: 0%;
width: 62px;
height: 70px;
padding: 0px 8px 0px 0px;
background: radial-gradient(ellipse 20px 90px at 110% 50%, transparent 50%, rgb(40, 165, 92) 50%, rgb(40, 165, 92) 62%, transparent 63%), radial-gradient(ellipse 20px 90px at 110% 50%, transparent 50%, rgb(138, 159, 212) 50%, rgb(138, 159, 212) 60%, transparent 70%), linear-gradient(to bottom right, white 45%, rgb(40, 165, 92) 46%), linear-gradient(to bottom right, white 48%, rgb(138, 159, 212) 49%);
background-clip: border-box, border-box, content-box, border-box;
background-size: 95% 100%, 100% 85%, 100% 100%, 95% 85%;
background-repeat: no-repeat;
transform: rotate(90deg);
z-index: -1;
}
<div class="mainDiv">
<div class="square"></div>
<div class="square2"></div>
<div class="square3"></div>
</div>
i played also with gradient from a single div and 2 pseudos:
The idea is to pile bits of gradients to shape the curved parts.
#cube{
display: inline-flex;
align-items: center;
justify-content: center;
background: #DF1C40;
color: white;
width: 75px;
height: 182px;
margin: 78px;
position: relative;
transform: skew(40deg, 10deg) rotate(40deg);
}
#cube:before,
#cube:after {
display: inherit;
align-items: center;
justify-content: center;
content: '';
position: absolute;
top: 0;
left: 0px;
right: 0px;
bottom: 0;
background: #FF9D28;
border-radius: inherit;
box-shadow: inherit;
transform: translate(100%, -50%) skew( 0deg, -67deg) rotate(0deg);
}
#cube:after {
content: '';
top: 0px;
left: 0;
height: 106%;
right: 0;
width: 85%;
bottom: 0;
transform: translate(68%, -96%) rotate(30deg)skew(7deg, -30deg);
background:
linear-gradient(to top left, white 42%, transparent 43%),
linear-gradient(141deg, transparent 80%, white 75%),
linear-gradient(-265deg, transparent 80%, white 75%),
linear-gradient(-5deg, #28A55c 45%, transparent 46%) 20px -6px no-repeat,
linear-gradient(25deg, #28A55c 45%, transparent 46%) 7px 38px no-repeat,
linear-gradient(-97deg, #28A55c 44%, transparent 46%) 2px 38px no-repeat,
linear-gradient(140deg, transparent 45%, #28A55c 46%) 22px 16px no-repeat,
linear-gradient(265deg, #28A55c 0%, transparent 0%) -17px 46px no-repeat,
linear-gradient(272deg, #28A55c 50%, transparent 51%) -7px 120px no-repeat,
linear-gradient(267deg, #28A55c 50%, transparent 51%) -13px 75px no-repeat,
linear-gradient(265deg, #28A55c 45% , transparent 46% ) -20px 46px no-repeat,
linear-gradient(-95deg, rgba(0, 0, 0, 0.1) 45%, transparent 46%) -23px 48px no-repeat,
linear-gradient(to bottom right, #97BBDD 58%, transparent 58%);
background-size: 100% 100%, auto, auto, 60% 50%,60% 5%,13% 10%, 60% 45%, 100% 70%, 60% 45%, 80% 45%, auto;
}
body {
background:#333;
font-family:tahoma;
font-weight:bold
}
p {position:absolute;color:white;}
<p>wich is which ?</p>
<div id="cube">
CSS <br/> box
</div>
<img src="http://i.stack.imgur.com/0Y3vw.png"/>
codepen to play with
I have played with linear-gradient & Position property to get similar design.
As you can see i had to take few extra element for curve. For more detail about corner read here
Hope it will help..
.mainDiv{
position: relative;
width: 206px;
height: 190px;
margin: 0px auto;
margin-top:100px;
}
.square{
width:100px;
height:100px;
background:#df1c40;
float:left;
transform: skew(180deg,210deg);
position: absolute;
top: 42px;
}
.square2{
width:100px;
height:100px;
background:#ff9c28;
float:left;
transform: skew(180deg,150deg);
position: absolute;
left:100px;
top: 42px;
}
.square3{
width:117px;
height:100px;
background:#97bbdd;
float:left;
transform: rotate(150deg) translate(-40px, -16px) skew(30deg, 0deg);
position: absolute;
left: -1px;
top: -31px;
}
.square3:before {
content: "";
position: absolute;
top: 2%;
right: 0%;
left: 44%;
width: 0px;
height: 0px;
border-bottom: 60px solid transparent;
border-left: 60px solid transparent;
-webkit-box-shadow: 6px 0px 0px -1px #879fd1;
-moz-box-shadow: 6px 0px 0px -1px #879fd1;
box-shadow: 6px 0px 0px -1px #879fd1;
transform: rotate(84deg);
z-index:0;
}
.square3:after {
content: "";
position: absolute;
top: 0%;
right: 0%;
width: 0px;
height: 0px;
border-top: 73px solid #FFF;
border-right: 73px solid transparent;
transform: rotate(90deg);
}
#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: 96%;
top: 0%;
background: -webkit-radial-gradient(-180% 200%, circle, rgba(151,187,221,1) 85%, rgba(135,159,209,.8) 93%);
border-right: solid 2px #28A55C;
box-shadow: 17px -3px 1px -18px #FFF;
z-index: -1;
}
#fpc_page-tip:after {
top: 96%;
right: 0%;
background: -webkit-radial-gradient(-250% 320%, circle, rgba(151,187,221,0) 85%, rgba(135,159,209,.8) 93%);
border-top: solid 2px #28A55C;
box-shadow: 17px -3px 1px -18px #FFF;
z-index: 0;
}
#fpc_corner-box { /* edit these sizes for the default revealing corner size */
height: 20px;
width: 20px;
right: 0;
top: 0;
position: absolute;
overflow: visible;
height: 65px;
width: 65px;
}
#fpc_corner-box:before {
position: absolute;
top: 0;
right: 0;
/*content: "";*/
display: block;
width: 100%;
height: 100%;
}
#fpc_page-tip {
position: absolute;
top: 0;
right: 0;
content: "";
background: -webkit-linear-gradient(45deg, #28a55c 17%, #28a55c 18%, #48A26E 30%, #41A76B 34%, #2FCA70 49%, rgba(200,200,200,0) 36%);
display: block;
width: 100%;
height: 100%;
}
#fpc_corner-box, #fpc_page-tip {
-webkit-transition-property: all;
-webkit-transition-duration: .3s;
-webkit-transition-timing-function: cubic-bezier(0, 0.35, .5, 1.7);
}
<div class="mainDiv">
<div class="square"></div>
<div class="square2"></div>
<div class="square3">
<div id="fpc_corner-box">
<a id="fpc_page-tip" href="#">
</a>
</div>
</div>
</div>
So I don't really know how to explain this in words. But this is what I'm trying to achieve
and this is what I've done so far link
ul.quicktabs-tabs li {
float: left;
height: 20px;
margin: 0;
margin-right:-20px;
padding: 0;
width:150px;
background: transparent;
}
ul.quicktabs-tabs li a {
font-family: inherit;
margin: 0;
display: block;
padding: 10px 27px 10px 7px;
text-decoration: none;
color: #6da648 !important;
border: 2px solid #6da648;
border-radius: 6px;
margin: 0;
background:#fff;
}
ul.quicktabs-tabs li.active a, ul.quicktabs-tabs li.active a:hover {
color: #fff !important;
background-position: right -20px;
background: #6da648;
}
ul.quicktabs-tabs {
margin: 0 0 10px 0;
font-size: 11px;
list-style: none;
padding: 1px 23px 23px 0;
}
<ul class="quicktabs-tabs">
<li class="active">Item 1</li>
<li>Item 2</li>
</ul>
<li> element at the right overlaps <li> element at the left. Set z-index and position of the element with class active to prevent that overlapping, adjust some paddings and margins.
ul.quicktabs-tabs li {
float: left;
height: 20px;
margin: 0;
margin-right:-8px;
padding: 0;
width:150px;
background: transparent;
}
ul.quicktabs-tabs li a {
font-family: inherit;
margin: 0;
display: block;
padding: 10px 27px 10px 12px;
text-decoration: none;
color: #6da648 !important;
border: 2px solid #6da648;
border-radius: 6px;
margin: 0;
background:#fff;
}
ul.quicktabs-tabs li.active a, ul.quicktabs-tabs li.active a:hover {
color: #fff !important;
background-position: right -20px;
background: #6da648;
z-index: 1000;
position: relative;
}
ul.quicktabs-tabs {
margin: 0 0 10px 0;
font-size: 11px;
list-style: none;
padding: 1px 23px 23px 0;
}
<ul class="quicktabs-tabs">
<li>Item 0</li>
<li class="active">Item 1</li>
<li>Item 2</li>
</ul>
I create a progress bar using css3 progress bar guide:
.meter {
height: 40px;
/* Can be anything */
position: relative;
margin: 60px 0 20px 0;
/* Just for demo spacing */
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
-webkit-box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
-moz-box-shadow : inset 0 -1px 1px rgba(255, 255, 255, 0.3);
box-shadow : inset 0 -1px 1px rgba(255, 255, 255, 0.3);
border: solid 1px orange;
}
.meter > span {
display: block;
height: 100%;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-bottomright: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-top-left-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-topleft: 20px;
-moz-border-radius-bottomleft: 20px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: rgb(43, 194, 83);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(43, 194, 83)), color-stop(1, rgb(84, 240, 84)));
background-image: -moz-linear-gradient(center bottom, rgb(43, 194, 83) 37%, rgb(84, 240, 84) 69%);
-webkit-box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
-moz-box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
position: relative;
overflow: hidden;
}
.meter > span:after, .animate > span > span {
content:"";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
z-index: 1;
-webkit-background-size: 50px 50px;
-moz-background-size: 50px 50px;
background-size: 50px 50px;
-webkit-animation: move 2s linear infinite;
-moz-animation: move 2s linear infinite;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-bottomright: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-top-left-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-topleft: 20px;
-moz-border-radius-bottomleft: 20px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
overflow: hidden;
}
.animate > span:after {
display: none;
}
#-webkit-keyframes move {
0% {
background-position: 0 0;
}
100% {
background-position: 50px 50px;
}
}
#-moz-keyframes move {
0% {
background-position: 0 0;
}
100% {
background-position: 50px 50px;
}
}
.orange > span {
background-color: #f1a165;
background-image: -moz-linear-gradient(top, #f1a165, #f36d0a);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f1a165), color-stop(1, #f36d0a));
background-image: -webkit-linear-gradient(#f1a165, #f36d0a);
}
.red > span {
background-color: #f0a3a3;
background-image: -moz-linear-gradient(top, #f0a3a3, #f42323);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0a3a3), color-stop(1, #f42323));
background-image: -webkit-linear-gradient(#f0a3a3, #f42323);
}
.nostripes > span > span, .nostripes > span:after {
-webkit-animation: none;
-moz-animation: none;
background-image: none;
}
<div class="meter orange nostripes"> <span style="width: 33.3%"></span>
</div>
Also you can animated it if you want to use jquery:
$(".meter > span").each(function() {
$(this)
.data("origWidth", $(this).width())
.width(0)
.animate({
width: $(this).data("origWidth")
}, 1200);
});
.meter {
height: 40px;
/* Can be anything */
position: relative;
margin: 60px 0 20px 0;
/* Just for demo spacing */
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
-webkit-box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3);
-moz-box-shadow : inset 0 -1px 1px rgba(255, 255, 255, 0.3);
box-shadow : inset 0 -1px 1px rgba(255, 255, 255, 0.3);
border: solid 1px orange;
}
.meter > span {
display: block;
height: 100%;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-bottomright: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-top-left-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-topleft: 20px;
-moz-border-radius-bottomleft: 20px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
background-color: rgb(43, 194, 83);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(43, 194, 83)), color-stop(1, rgb(84, 240, 84)));
background-image: -moz-linear-gradient(center bottom, rgb(43, 194, 83) 37%, rgb(84, 240, 84) 69%);
-webkit-box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
-moz-box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
box-shadow: inset 0 2px 9px rgba(255, 255, 255, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
position: relative;
overflow: hidden;
}
.meter > span:after, .animate > span > span {
content:"";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
z-index: 1;
-webkit-background-size: 50px 50px;
-moz-background-size: 50px 50px;
background-size: 50px 50px;
-webkit-animation: move 2s linear infinite;
-moz-animation: move 2s linear infinite;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-bottomright: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-top-left-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-topleft: 20px;
-moz-border-radius-bottomleft: 20px;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
overflow: hidden;
}
.animate > span:after {
display: none;
}
#-webkit-keyframes move {
0% {
background-position: 0 0;
}
100% {
background-position: 50px 50px;
}
}
#-moz-keyframes move {
0% {
background-position: 0 0;
}
100% {
background-position: 50px 50px;
}
}
.orange > span {
background-color: #f1a165;
background-image: -moz-linear-gradient(top, #f1a165, #f36d0a);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f1a165), color-stop(1, #f36d0a));
background-image: -webkit-linear-gradient(#f1a165, #f36d0a);
}
.red > span {
background-color: #f0a3a3;
background-image: -moz-linear-gradient(top, #f0a3a3, #f42323);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0a3a3), color-stop(1, #f42323));
background-image: -webkit-linear-gradient(#f0a3a3, #f42323);
}
.nostripes > span > span, .nostripes > span:after {
-webkit-animation: none;
-moz-animation: none;
background-image: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="meter orange nostripes"> <span style="width: 33.3%"></span>
</div>
Here you go:
http://jsfiddle.net/r0L0nty2/43/
You must give the whole list a border instead of the list items. This is fixed with this code now.
ul.quicktabs-tabs li {
height: 20px;
width:150px;
float: left;
background: transparent;
}
ul.quicktabs-tabs li a {
font-family: inherit;
margin: 0;
display: block;
padding: 10px 27px 10px 7px;
text-decoration: none;
color: #6da648 !important;
margin: 0;
background:#fff;
}
ul.quicktabs-tabs li.active a { border-radius: 0 18px 18px 0;}
ul.quicktabs-tabs li.active a, ul.quicktabs-tabs li.active a:hover {
color: #fff !important;
background-position: right -20px;
background: #6da648;
}
ul.quicktabs-tabs {
margin: 0 0 10px 0;
font-size: 11px;
list-style: none;
padding: 0 0 34px 0;
border: 2px solid #6da648;
}
<ul class="quicktabs-tabs">
<li class="active">Item 1</li>
<li>Item 2</li>
</ul>
I am trying to create a page curl effect using CSS3. That effect should be something similar to this -
I tried to get it to work but couldn't figure it out.
This is my code sofar
.nav {
width: 200px;
background: #353942;
height: 50px;
position: relative;
}
.curl {
width:70px;
height:50px;
position: absolute;
top:0;
right:0;
background: linear-gradient(
25deg,
#4c4c4c 0%,
#474747 39%,
#2c2c2c 50%,
#000000 51%,
#111111 60%,
#2b2b2b 76%,
#1c1c1c 91%,
#131313 100%);
box-shadow : 0 0 10px rgba(0,0,0,0.5);
transition: all .5s ease;
}
.curl:before,
.curl:after {
content: '';
position: absolute;
z-index: -1;
left: 12.5%;
bottom: 5.8%;
width: 70%;
max-width: 300px;
max-height: 100px;
height: 55%;
box-shadow: 0 12px 15px rgba(0, 0, 0, 0.3);
transform: skew(-10deg) rotate(-6deg);
}
.curl:after {
left: auto;
right: 5.8%;
bottom: auto;
top: 14.16%;
transform: skew(-25deg) rotate(-84deg);
}
.curl:hover {
width: 120px;
height: 50px;
}
.curl:hover:before,
.curl:hover:after {
box-shadow: 0 24px 30px rgba(0, 0, 0, 0.3);
}
This is JS BIN
Can anybody tell me how I figure this out?
Any ideas would be greatly appreciated.
Thank you.
check this out.
.nav {
width: 200px;
background: #353942;
height: 50px;
position: relative;
}
.curl {
width:120px;
height:120px;
position: absolute;
top:0;
left:0;
background :
linear-gradient(
135deg,
#fff,
#f3f3f3 45%,
#ddd 50%,
#aaa 50%,
#bbb 56%,
#ccc 62%,
#f3f3f3 80%,
#fff 100%
);
box-shadow : 0 0 10px rgba(0, 0, 0, .5);
transition: all .5s ease;
}
.curl:before,
.curl:after {
content: '';
position: absolute;
z-index: -1;
left: 12.5%;
bottom: 5.8%;
width: 70%;
max-width: 300px;
max-height: 100px;
height: 55%;
box-shadow: 0 12px 15px rgba(0, 0, 0, .3);
transform: skew(-10deg) rotate(-6deg);
}
.curl:after {
left: auto;
right: 5.8%;
bottom: auto;
top: 14.16%;
transform: skew(-15deg) rotate(-84deg);
}
.curl:hover {
width: 240px;
height: 240px;
}
.curl:hover:before,
.curl:hover:after {
box-shadow: 0 24px 30px rgba(0, 0, 0, .3);
}
I am trying ti add this form to my webpage but for some reason I cannot put the form in the top right corner of the header.
Here is the html:
$(function(){
var $form_inputs = $('form input');
var $rainbow_and_border = $('.rain, .border');
/* Used to provide loping animations in fallback mode */
$form_inputs.bind('focus', function(){
$rainbow_and_border.addClass('end').removeClass('unfocus start');
});
$form_inputs.bind('blur', function(){
$rainbow_and_border.addClass('unfocus start').removeClass('end');
});
$form_inputs.first().delay(800).queue(function() {
$(this).focus();
});
});
</script>
<style>
</style>
</head>
<body id="home">
<div class="rain">
<div class="border start">
<form>
<label for="email">Email</label>
<input name="email" type="text" placeholder="Email"/>
<label for="pass">Password</label>
<input name="pass" type="password" placeholder="Password"/>
<input type="submit" value="LOG IN"/>
</form>
</div>
</div>
And this is the all the form CSS if it helps..
/* Login Form
-------------------------------------------*/
.border,
.rain{
height: 170px;
width: 320px;
float: right;
}
/* Layout with mask */
.rain{
padding: 10px 12px 12px 10px;
-moz-box-shadow: 10px 10px 10px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
-webkit-box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
margin: 0 0 140px 0 auto;
}
/* Artifical "border" to clear border to bypass mask */
.border{
padding: 1px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.border,
.rain,
.border.start,
.rain.start{
background-repeat: repeat-x, repeat-x, repeat-x, repeat-x;
background-position: 0 0, 0 0, 0 0, 0 0;
/* Blue-ish Green Fallback for Mozilla */
background-image: -moz-linear-gradient(left, #09BA5E 0%, #00C7CE 15%, #3472CF 26%, #00C7CE 48%, #0CCF91 91%, #09BA5E 100%);
/* Add "Highlight" Texture to the Animation */
background-image: -webkit-gradient(linear, left top, right top, color-stop(1%,rgba(0,0,0,.3)), color-stop(23%,rgba(0,0,0,.1)), color-stop(40%,rgba(255,231,87,.1)), color-stop(61%,rgba(255,231,87,.2)), color-stop(70%,rgba(255,231,87,.1)), color-stop(80%,rgba(0,0,0,.1)), color-stop(100%,rgba(0,0,0,.25)));
/* Starting Color */
background-color: #39f;
/* Just do something for IE-suck */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00BA1B', endColorstr='#00BA1B',GradientType=1 );
}
/* Non-keyframe fallback animation */
.border.end,
.rain.end{
-moz-transition-property: background-position;
-moz-transition-duration: 30s;
-moz-transition-timing-function: linear;
-webkit-transition-property: background-position;
-webkit-transition-duration: 30s;
-webkit-transition-timing-function: linear;
-o-transition-property: background-position;
-o-transition-duration: 30s;
-o-transition-timing-function: linear;
transition-property: background-position;
transition-duration: 30s;
transition-timing-function: linear;
background-position: -5400px 0, -4600px 0, -3800px 0, -3000px 0;
}
/* Keyfram-licious animation */
#-webkit-keyframes colors {
0% {background-color: #39f;}
15% {background-color: #F246C9;}
30% {background-color: #4453F2;}
45% {background-color: #44F262;}
60% {background-color: #F257D4;}
75% {background-color: #EDF255;}
90% {background-color: #F20006;}
100% {background-color: #39f;}
}
.border,.rain{
-webkit-animation-direction: normal;
-webkit-animation-duration: 20s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: colors;
-webkit-animation-timing-function: ease;
}
/* In-Active State Style */
.border.unfocus{
background: #333 !important;
-moz-box-shadow: 0px 0px 15px rgba(255,255,255,.2);
-webkit-box-shadow: 0px 0px 15px rgba(255,255,255,.2);
box-shadow: 0px 0px 15px rgba(255,255,255,.2);
-webkit-animation-name: none;
}
.rain.unfocus{
background: #000 !important;
-webkit-animation-name: none;
}
/* Regular Form Styles */
form{
background: #212121;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
height: 100%;
width: 100%;
background: -moz-radial-gradient(50% 46% 90deg,circle closest-corner, #242424, #090909);
background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 150, from(#242424), to(#090909));
}
form label{
display: block;
padding: 5px 5px 5px 10px;
font-size: 11px;
color: #777;
}
form input{
display: block;
margin: 5px 5px 15px 10px;
width: 85%;
background: #111;
-moz-box-shadow: 0px 0px 4px #000 inset;
-webkit-box-shadow: 0px 0px 4px #000 inset;
box-shadow: 0px 0px 4px #000 inset;
outline: 1px solid #333;
border: 1px solid #000;
padding: 5px;
color: #444;
font-size: 16px;
}
form input:focus{
outline: 1px solid #555;
color: #FFF;
}
input[type="submit"]{
color: #999;
padding: 5px 5px;
float: right;
margin: 20px 0;
border: 1px solid #000;
font-weight: lighter;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
background: #45484d;
background: -moz-linear-gradient(top, #222 0%, #111 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222), color-stop(100%,#111));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22222', endColorstr='#11111',GradientType=0 );
-moz-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset;
-webkit-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset;
box-shadow: 0px 1px 1px #000,0px 1px 0px rgba(255,255,255,.3) inset;
text-shadow: 0 1px 1px #000;
}
You can use absolute positioning for this:
.rain {
position:absolute;
right:0;
top:0;
}