Round ribbon at the bottom right corner with icon and text in it











up vote
1
down vote

favorite
1












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.enter image description here.



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;}









share|improve this question


























    up vote
    1
    down vote

    favorite
    1












    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.enter image description here.



    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;}









    share|improve this question
























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      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.enter image description here.



      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;}









      share|improve this question













      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.enter image description here.



      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 5:02









      stephen

      34119




      34119
























          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>








          share|improve this answer




























            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;
            }


            2



            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.
            enter image description here
            Hope this helps.:)






            share|improve this answer























              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',
              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
              });


              }
              });














               

              draft saved


              draft discarded


















              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








              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>








              share|improve this answer

























                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>








                share|improve this answer























                  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>








                  share|improve this answer












                  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>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 11 at 7:10









                  Abolfazl Panbehkar

                  763




                  763
























                      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;
                      }


                      2



                      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.
                      enter image description here
                      Hope this helps.:)






                      share|improve this answer



























                        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;
                        }


                        2



                        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.
                        enter image description here
                        Hope this helps.:)






                        share|improve this answer

























                          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;
                          }


                          2



                          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.
                          enter image description here
                          Hope this helps.:)






                          share|improve this answer














                          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;
                          }


                          2



                          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.
                          enter image description here
                          Hope this helps.:)







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 13 at 5:30

























                          answered Nov 11 at 7:59









                          hong cai

                          334




                          334






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Bressuire

                              Vorschmack

                              Quarantine