Round ribbon at the bottom right corner with icon and text in it
up vote
1
down vote
favorite
I am learning css and working on a project where I need to display a rounded ribbon at the bottom right corner of the web page along with icon and text in it. Below is the screenshot of the design that I am trying to achieve..
So far I am able to display the ribbon but unable to keep the icon and text normal. Here is the link to Codepen: https://codepen.io/stephen0roper/pen/JeKdJV
CSS Code:
/* The ribbons */
.corner-ribbon{
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: left;
line-height: 100px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
/* Different positions */
.corner-ribbon.top-left{
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red{background: #e43;}
html css html5
add a comment |
up vote
1
down vote
favorite
I am learning css and working on a project where I need to display a rounded ribbon at the bottom right corner of the web page along with icon and text in it. Below is the screenshot of the design that I am trying to achieve..
So far I am able to display the ribbon but unable to keep the icon and text normal. Here is the link to Codepen: https://codepen.io/stephen0roper/pen/JeKdJV
CSS Code:
/* The ribbons */
.corner-ribbon{
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: left;
line-height: 100px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
/* Different positions */
.corner-ribbon.top-left{
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red{background: #e43;}
html css html5
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am learning css and working on a project where I need to display a rounded ribbon at the bottom right corner of the web page along with icon and text in it. Below is the screenshot of the design that I am trying to achieve..
So far I am able to display the ribbon but unable to keep the icon and text normal. Here is the link to Codepen: https://codepen.io/stephen0roper/pen/JeKdJV
CSS Code:
/* The ribbons */
.corner-ribbon{
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: left;
line-height: 100px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
/* Different positions */
.corner-ribbon.top-left{
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red{background: #e43;}
html css html5
I am learning css and working on a project where I need to display a rounded ribbon at the bottom right corner of the web page along with icon and text in it. Below is the screenshot of the design that I am trying to achieve..
So far I am able to display the ribbon but unable to keep the icon and text normal. Here is the link to Codepen: https://codepen.io/stephen0roper/pen/JeKdJV
CSS Code:
/* The ribbons */
.corner-ribbon{
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: left;
line-height: 100px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
/* Different positions */
.corner-ribbon.top-left{
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red{background: #e43;}
html css html5
html css html5
asked Nov 11 at 5:02
stephen
34119
34119
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
please look at this:
https://codepen.io/anon/pen/aQmJjy?editors=1100
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
add a comment |
up vote
1
down vote
Hi this is how I solved this puzzle:
1 remove the line-height:100px; in .corner-ribbon class
2 wrap the text and icon into a div and add a class"stop-rotate", and justneed to rotate it back 45deg:
.stop-rotate{
display:inline;
padding-top:30px;
float:left;
transform: rotate(-45deg);
text-align:center;
}
3 edit the html tags, and change the icon to fa-2x
<div class="corner-ribbon top-left sticky red shadow">
<div class="stop-rotate">Some text
<i class="fas fa-camera fa-2x" style="display:block"></i>
</div>
</div>
I have saved the Pen(for those who may need: https://codepen.io/anon/pen/OaRpOd ),you may still see the result and may need to edit the size a little bit.
Hope this helps.:)
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
please look at this:
https://codepen.io/anon/pen/aQmJjy?editors=1100
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
add a comment |
up vote
0
down vote
accepted
please look at this:
https://codepen.io/anon/pen/aQmJjy?editors=1100
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
please look at this:
https://codepen.io/anon/pen/aQmJjy?editors=1100
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
please look at this:
https://codepen.io/anon/pen/aQmJjy?editors=1100
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
/* The ribbons */
.corner-ribbon {
font-weight: bold;
width: 50px;
background: #e43;
position: absolute;
bottom: 5px;
right: -30px;
text-align: center;
line-height: 40px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(5deg);
-webkit-transform: rotate(5deg);
border-radius: 65px;
}
/* Custom styles */
.corner-ribbon.sticky {
position: fixed;
}
.corner-ribbon.shadow {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
/* Different positions */
.corner-ribbon.top-left {
bottom: -50px;
right: -100px;
transform: rotate(-270deg);
-webkit-transform: rotate(-315deg);
background-color: red;
width: 226px;
height: 125px;
}
.corner-ribbon.red {
background: #e43;
}
.rotate-text {
transform: rotate(270deg);
-webkit-transform: rotate(315deg);
position: absolute;
left: 15px;
top: 0;
font-family: sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
item-align: center;
height: 120px;
}
<link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet" />
<div class="corner-ribbon top-left sticky red shadow">
<div class="rotate-text">
<span>Some text</span>
<i class="fas fa-camera fa-2x"></i>
</div>
</div>
answered Nov 11 at 7:10
Abolfazl Panbehkar
763
763
add a comment |
add a comment |
up vote
1
down vote
Hi this is how I solved this puzzle:
1 remove the line-height:100px; in .corner-ribbon class
2 wrap the text and icon into a div and add a class"stop-rotate", and justneed to rotate it back 45deg:
.stop-rotate{
display:inline;
padding-top:30px;
float:left;
transform: rotate(-45deg);
text-align:center;
}
3 edit the html tags, and change the icon to fa-2x
<div class="corner-ribbon top-left sticky red shadow">
<div class="stop-rotate">Some text
<i class="fas fa-camera fa-2x" style="display:block"></i>
</div>
</div>
I have saved the Pen(for those who may need: https://codepen.io/anon/pen/OaRpOd ),you may still see the result and may need to edit the size a little bit.
Hope this helps.:)
add a comment |
up vote
1
down vote
Hi this is how I solved this puzzle:
1 remove the line-height:100px; in .corner-ribbon class
2 wrap the text and icon into a div and add a class"stop-rotate", and justneed to rotate it back 45deg:
.stop-rotate{
display:inline;
padding-top:30px;
float:left;
transform: rotate(-45deg);
text-align:center;
}
3 edit the html tags, and change the icon to fa-2x
<div class="corner-ribbon top-left sticky red shadow">
<div class="stop-rotate">Some text
<i class="fas fa-camera fa-2x" style="display:block"></i>
</div>
</div>
I have saved the Pen(for those who may need: https://codepen.io/anon/pen/OaRpOd ),you may still see the result and may need to edit the size a little bit.
Hope this helps.:)
add a comment |
up vote
1
down vote
up vote
1
down vote
Hi this is how I solved this puzzle:
1 remove the line-height:100px; in .corner-ribbon class
2 wrap the text and icon into a div and add a class"stop-rotate", and justneed to rotate it back 45deg:
.stop-rotate{
display:inline;
padding-top:30px;
float:left;
transform: rotate(-45deg);
text-align:center;
}
3 edit the html tags, and change the icon to fa-2x
<div class="corner-ribbon top-left sticky red shadow">
<div class="stop-rotate">Some text
<i class="fas fa-camera fa-2x" style="display:block"></i>
</div>
</div>
I have saved the Pen(for those who may need: https://codepen.io/anon/pen/OaRpOd ),you may still see the result and may need to edit the size a little bit.
Hope this helps.:)
Hi this is how I solved this puzzle:
1 remove the line-height:100px; in .corner-ribbon class
2 wrap the text and icon into a div and add a class"stop-rotate", and justneed to rotate it back 45deg:
.stop-rotate{
display:inline;
padding-top:30px;
float:left;
transform: rotate(-45deg);
text-align:center;
}
3 edit the html tags, and change the icon to fa-2x
<div class="corner-ribbon top-left sticky red shadow">
<div class="stop-rotate">Some text
<i class="fas fa-camera fa-2x" style="display:block"></i>
</div>
</div>
I have saved the Pen(for those who may need: https://codepen.io/anon/pen/OaRpOd ),you may still see the result and may need to edit the size a little bit.
Hope this helps.:)
edited Nov 13 at 5:30
answered Nov 11 at 7:59
hong cai
334
334
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245988%2fround-ribbon-at-the-bottom-right-corner-with-icon-and-text-in-it%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown