Round ribbon at the bottom right corner with icon and text in it
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.redbackground: #e43;
html css html5
add a comment |
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.redbackground: #e43;
html css html5
add a comment |
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.redbackground: #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.redbackground: #e43;
html css html5
html css html5
asked Nov 11 '18 at 5:02
stephenstephen
34119
34119
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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 |
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 |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 |
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 |
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 '18 at 7:10
Abolfazl PanbehkarAbolfazl Panbehkar
1114
1114
add a comment |
add a comment |
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 |
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 |
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 '18 at 5:30
answered Nov 11 '18 at 7:59
hong caihong cai
354
354
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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