I would like to find a ribbon rosette made in pure CSS3 and HTML or get tips on how to make one. I should look something like this one
Demo
Here's what I've tried...
<div class="star"></div>
<div class="circle">Ribbon Rosette</div>
.star {
left: 100px;
top: 100px;
height: 80px;
width: 80px;
background: silver;
position: absolute;
text-align:left;
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
}
.star:before {
height: 80px;
width: 80px;
background: silver;
content:"";
position: absolute;
/* Rotate */
-moz-transform: rotate(-30deg);
-webkit-transform: rotate(-30deg);
-ms-transform: rotate(-30deg);
-o-transform: rotate(-30deg);
transform: rotate(-30deg);
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
}
.star:after {
padding-top: 10px;
text-align: center;
vertical-align: middle;
height: 70px;
width: 80px;
background: silver;
content: "";
position: absolute;
/* Rotate */
-moz-transform: rotate(30deg);
-webkit-transform: rotate(30deg);
-ms-transform: rotate(30deg);
-o-transform: rotate(30deg);
transform: rotate(30deg);
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
}
.circle {
font: 400 18px/1.1 "freight-sans-pro",sans-serif;
color: #000000;
left: 95px;
top: 95px;
position: absolute;
text-align:center;
padding-top: 25px;
width: 90px;
height: 65px;
background: silver;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
box-shadow: 0px 0px 10px rgba(0,0,0,0.3);
background: #fceabb; /* Old browsers */
background: -moz-linear-gradient(top, #fceabb 0%, #fccd4d 50%, #f8b500 51%, #fbdf93 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fceabb), color-stop(50%,#fccd4d), color-stop(51%,#f8b500), color-stop(100%,#fbdf93)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fceabb 0%,#fccd4d 50%,#f8b500 51%,#fbdf93 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fceabb 0%,#fccd4d 50%,#f8b500 51%,#fbdf93 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fceabb 0%,#fccd4d 50%,#f8b500 51%,#fbdf93 100%); /* IE10+ */
background: linear-gradient(to bottom, #fceabb 0%,#fccd4d 50%,#f8b500 51%,#fbdf93 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#fbdf93',GradientType=0 ); /* IE6-9 */
}
First off all what you made is amazing, I added ribbons for you at the bottomby adding 2 span elements under div with a class .circle and added ribbon triangles virtually...
Demo
Demo 2 (Longer triangles tweaking border: 40px solid rgba(255,255,255,1);)
.circle span:nth-of-type(1) {
width: 40px;
height: 120px;
background: #F6C431;
content: "";
display: block;
position: absolute;
-moz-transform: rotate(10deg);
-webkit-transform: rotate(10deg);
transform: rotate(10deg);
z-index: -1;
left: 10px;
}
.circle span:nth-of-type(1):after {
content: "";
display: block;
position: absolute;
height: 0;
width: 0;
bottom: -1px;
left: 0;
border: 20px solid rgba(255,255,255,1);
border-top: 20px solid rgba(255,255,255,0);
border-left: 20px solid rgba(255,255,255,0);
border-right: 20px solid rgba(255,255,255,0);
}
.circle span:nth-of-type(2) {
width: 40px;
height: 80px;
background: #F6C431;
content: "";
display: block;
position: absolute;
-moz-transform: rotate(-10deg);
-webkit-transform: rotate(-10deg);
transform: rotate(-10deg);
z-index: -1;
left: 50px;
box-shadow: -10px -20px 10px 1px #D5A002;
}
.circle span:nth-of-type(2):after {
content: "";
display: block;
position: absolute;
height: 0;
width: 0;
bottom: -1px;
left: 0;
border: 20px solid rgba(255,255,255,1);
border-top: 20px solid rgba(255,255,255,0);
border-left: 20px solid rgba(255,255,255,0);
border-right: 20px solid rgba(255,255,255,0);
}
Related
CSS & Html:
body {background:#ccc}
.box h3{
text-align:center;
position:relative;
top:80px;
}
.box {
width:70%;
height:200px;
background:#FFF;
margin:40px auto;
}
.effect3
{
position: relative;
}
.effect3:before
{
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 10px;
width: 50%;
top: 80%;
max-width:300px;
background: #777;
-webkit-box-shadow: 0 15px 10px #777;
-moz-box-shadow: 0 15px 10px #777;
box-shadow: 0 15px 10px #777;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
}
<div class="box effect3">
<h3>Effect 3</h3>
</div>
I am trying to decorate a box with a shadow.
The above css is for the shadow bottom and left (in the red circle).
What can be the css to apply to the top and left (red arrow)?
Please use these code for top left box-shadow:
.effect3:before {
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 3px;
width: 18%;
top: 24px;
max-width: 300px;
background: #777;
-webkit-box-shadow: -8px 15px 10px #777;
-moz-box-shadow: -8px 15px 10px #777;
-webkit-transform: rotate(87deg);
-moz-transform: rotate(87deg);
transform: rotate(87deg);
}
body {
background: #ccc
}
.box h3 {
text-align: center;
position: relative;
top: 80px;
}
.box {
width: 70%;
height: 200px;
background: #FFF;
margin: 40px auto;
}
.effect3 {
position: relative;
}
.effect3:before {
z-index: -1;
position: absolute;
content: "";
left: -46px;
width: 20%;
bottom: 15px;
top: 25%;
max-width: 300px;
height: 20px;
background: #777;
-webkit-box-shadow: 0 15px 10px #777;
-moz-box-shadow: 0 15px 10px #777;
box-shadow: -10px -5px 10px #777;
-webkit-transform: rotate(-93deg);
-moz-transform: rotate(-93deg);
-o-transform: rotate(-93deg);
-ms-transform: rotate(-93deg);
transform: rotate(-93deg);
}
I think this is what you asking...
-webkit-box-shadow: -6px -8px 5px 0px rgba(50, 50, 50, 0.75);
-moz-box-shadow: -6px -8px 5px 0px rgba(50, 50, 50, 0.75);
box-shadow: -6px -8px 5px 0px rgba(50, 50, 50, 0.75);
Generated using http://css3gen.com/box-shadow/
Use an after and changing the before like so:
.effect3:before {
z-index: -1;
position: absolute;
content: "";
left: 15px;
width: 50%;
bottom: 15px;
top: 4%;
max-width: 300px;
height: 20px;
background: #777;
-webkit-box-shadow: 0 15px 10px #777;
-moz-box-shadow: 0 15px 10px #777;
box-shadow: -10px -5px 10px #777;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(3deg);
}
.effect3:after {
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 10px;
width: 50%;
top: 80%;
max-width: 300px;
background: #777;
-webkit-box-shadow: 0 15px 10px #777;
-moz-box-shadow: 0 15px 10px #777;
box-shadow: 0 15px 10px #777;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
}
Here is the JSFiddle demo
I use mutiple Background. I use a before Element in the back of an multibackground with Css3 code and a background-image.
and i have also an other Background called (apc-container)behind this Background.
My problem is that the before Element is also behind the #acp-container.
in the pseudo element before i use the z-index.
i try to use this also in the #acp-container but it does not work.
So how i bring the before pseudo Element in front of the #apc-container and in the back of the #subfilter a BG?
you can check it out with this code and you see the problem easy.
#streams-container,
#acp-container {
border-radius: 10px;
background-color: #f8f8f8;
min-height: 500px;
}
.subfilter {
margin-top: 160px;
}
.subfilter a {
margin-right: 130px;
margin-left: 130px;
width: 145px;
height: 145px;
display: inline-block;
position: relative;
line-height: 145px;
background-size: auto auto, auto auto;
background-color: #eaeaea;
background-image: url(images/Eye.png), -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#eaeaea));
background-image: url(images/Eye.png), -webkit-linear-gradient(top, #f6f6f6, #eaeaea);
background-image: url(images/Eye.png), -moz-linear-gradient(top, #f6f6f6, #eaeaea);
background-image: url(images/Eye.png), -ms-linear-gradient(top, #f6f6f6, #eaeaea);
background-image: url(images/Eye.png), -o-linear-gradient(top, #f6f6f6, #eaeaea);
background-image: url(images/Eye.png), linear-gradient(top, #f6f6f6, #eaeaea);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 2px 3px rgba(0, 0, 0, .1);
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 2px 3px rgba(0, 0, 0, .1);
box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 2px 3px rgba(0, 0, 0, .1);
}
.subfilter a.finiwatch {
background-position: 0px -172px, 0 0;
}
.subfilter a:active {
top: 1px;
}
.subfilter a::before {
content: '';
position: absolute;
z-index: -1;
top: -8px;
right: -8px;
bottom: -8px;
left: -8px;
background-color: #eaeaea;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.5;
}
.subfilter a:active::before {
top: -9px;
}
.subfilter a:hover::before {
opacity: 1;
}
.subfilter a.finiwatch:hover::before {
background-color: #B3F390;
}
.subfilter a:hover {
top: 0px, 1px;
}
.subfilter a.finiwatch:hover {
background-position: -160px -158px, 0 0;
}
.subfilter a:active {
background: url(images/Eye.png), -moz-linear-gradient(top, #eaeaea, #f6f6f6);
background-image: url(images/Eye.png), -webkit-gradient(linear, left top, left bottom, from(#eaeaea), to(#f6f6f6));
background-image: url(images/Eye.png), -webkit-linear-gradient(top, #eaeaea, #f6f6f6);
background-image: url(images/Eye.png), -moz-linear-gradient(top, #eaeaea, #f6f6f6);
background-image: url(images/Eye.png), -ms-linear-gradient(top, #eaeaea, #f6f6f6);
background-image: url(images/Eye.png), -o-linear-gradient(top, #eaeaea, #f6f6f6);
background-image: url(images/Eye.png), linear-gradient(top, #eaeaea, #f6f6f6);
}
.subfilter a.finiwatch:active {
background-position: -318px -158px, 0 0;
}
.subfilter a.finiwatch:selected {
background-position: -318px -158px, 0 0;
}
<div id="streams-container">
<div class="subfilter">
<a class="finiwatch" href=""></a>
</div>
For everyone stumbling accross this...
#streams-container {
border-radius: 10px;
background-color: #f8f8f8;
min-height: 500px;
position: relative;
z-index: 1;
}
.subfilter {
margin-top: 160px;
}
.subfilter a {
margin-right: 130px;
margin-left: 130px;
width: 145px;
height: 145px;
display: inline-block;
position: relative;
line-height: 145px;
background-size: auto auto, auto auto;
background-color: blue;
}
.subfilter a.finiwatch {
background-position: 0px -172px, 0 0;
}
.subfilter a::before {
content: '';
position: absolute;
z-index: 10;
top: -8px;
right: -8px;
bottom: -8px;
left: -8px;
background-color: pink;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.5;
}
.subfilter a:active::before {
top: -9px;
}
.subfilter a:hover::before {
opacity: 1;
}
.subfilter a.finiwatch:hover::before {
background-color: #B3F390;
}
.subfilter a:hover {
top: 0px, 1px;
}
.subfilter a.finiwatch:hover {
background-position: -160px -158px, 0 0;
}
<div id="streams-container">
<div class="subfilter">
<a class="finiwatch" href=""></a>
</div>
</div>
Found a way
give apc-container a relative position and a z-index of 1 and teh before element a z-index of -10.
#streams-container,
#acp-container {
border-radius: 10px;
background-color: #f8f8f8;
min-height: 500px;
position: relative;
z-index: 1;
}
.subfilter a::before {
content: '';
position: absolute;
z-index: -10;
top: -8px;
right: -8px;
bottom: -8px;
left: -8px;
background-color: #eaeaea;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
opacity: 0.5;
}
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>
arc button
i want to create an arc button like shown in the link . is it possible with css
i have tried the following code but i wanted to remove the white portion at the bottom of it so that it may look like an arc as shown in the image
thankyou
nav {
width: 400px;
height: 400px;
background: transparent;
border-radius: 50%;
padding: 20px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
}
.button {
display: block;
width: 30%;
height: 30%;
margin: 2%;
position: relative;
float: left;
box-shadow: 1px 0px 3px 1px rgba(0, 0, 0, 0.4), inset 0 0 0 1px #FFF;
}
.button::after {
content: "";
display: block;
width: 50%;
height: 50%;
background: transparent;
position: absolute;
border-radius: inherit;
}
.button.top {
border-radius: 100% 0 0 0;
background: -webkit-radial-gradient(bottom right, ellipse cover, #fff 35%, #eee 75%);
background: radial-gradient(ellipse cover at bottom right, #ffffff 35%, #eeeeee 75%);
}
.button.top::after {
bottom: 0;
right: 0;
box-shadow: inset 2px 1px 2px 0 rgba(0, 0, 0, 0.4), 10px 10px 0 10px transparent;
-webkit-transform: skew(-3deg, -3deg) scale(0.96);
-moz-transform: skew(-3deg, -3deg) scale(0.96);
transform: skew(-3deg, -3deg) scale(0.96);
}
<nav>
<a class="button top" href="#"><i class="icon-play"></i></a>
</nav>
How would I have a top right corner div as shown in the image. I want to do something similar though not exactly the same. I think the text is not an image.
Also, I have seen some websites that has a page hover effect when a mouse is over the top right section. Any idea how to do that?
If the text isn't an image, none of the other answers will work. Here is some css that rotates a div 45 degrees and works in IE + FF + Webkit.
#yourdiv
{
top: 0px;
right: 0px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
filter: progid:DXImageTransform.Microsoft.Matrix(M11='0.7071067811865476', M12='-0.7071067811865475', M21='0.7071067811865475', M22='0.7071067811865476', sizingMethod='auto expand');
}
Make sure it's a transparent PNG
#Element {
position: fixed;
top:0;
right:0;
z-index:10;
}
(An element with greater stack order is always in front of an element with a lower stack order.)
div.topRight {
position: absolute;
top: 0%;
right: 0%;
}
This will assign a division with class set as 'topRight' to the top right corner. I'm sure you can figure out how to get the image to show up properly from that. Make sure you set the proper width and height on it. As for hovering, what exact effects do you want? You can modify the CSS on hover easily, if that's all you want to do.
div.topRight:hover {
// new css rules
}
you may want to take a look at this JSFiddle:
Css:
.wrapper {
margin: 50px auto;
width: 280px;
height: 370px;
background: white;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
position: relative;
z-index: 90;
}
.ribbon-wrapper-green {
width: 85px;
height: 88px;
overflow: hidden;
position: absolute;
top: -3px;
right: -3px;
}
.ribbon-green {
font: bold 15px Sans-Serif;
color: #333;
text-align: center;
text-shadow: rgba(255,255,255,0.5) 0px 1px 0px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
position: relative;
padding: 7px 0;
left: -5px;
top: 15px;
width: 120px;
background-color: #BFDC7A;
background-image: -webkit-gradient(linear, left top, left bottom, from(#BFDC7A), to(#8EBF45));
background-image: -webkit-linear-gradient(top, #BFDC7A, #8EBF45);
background-image: -moz-linear-gradient(top, #BFDC7A, #8EBF45);
background-image: -ms-linear-gradient(top, #BFDC7A, #8EBF45);
background-image: -o-linear-gradient(top, #BFDC7A, #8EBF45);
color: #6a6340;
-webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
}
.ribbon-green:before, .ribbon-green:after {
content: "";
border-top: 3px solid #6e8900;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
position:absolute;
bottom: -3px;
}
.ribbon-green:before {
left: 0;
}
.ribbon-green:after {
right: 0;
}
html:
<div class="wrapper">
<div class="ribbon-wrapper-green"><div class="ribbon-green">NEWS</div></div>
</div>
I'm assuming you want fixed positioning.
#Element {
position: fixed;
top:0;
right:0;
}