Not able to make the CSS3 animation as continuous2019 Community Moderator ElectionMake a div fill the height of the remaining screen spaceHow to make div not larger than its contents?How to make a div 100% height of the browser window?How do I combine a background-image and CSS3 gradient on the same element?Make the cursor a hand when a user hovers over a list itemMaintaining the final state at end of a CSS3 animationcss3 :hover animation not working on firefoxCSS3 - Image SlideshowCSS animation rules disappear in Firefox resulting in no animationDraw a vertical line upward with CSS3 SVG animation

Is King K. Rool's down throw to up-special a true combo?

Ban on all campaign finance?

Can infringement of a trademark be pursued for using a company's name in a sentence?

Should QA ask requirements to developers?

Plywood subfloor won't screw down in a trailer home

Excess Zinc in garden soil

Is it true that real estate prices mainly go up?

Good allowance savings plan?

Coworker uses her breast-pump everywhere in the office

Need some help with my first LaTeX drawing…

Running a subshell from the middle of the current command

If Invisibility ends because the original caster casts a non-concentration spell, does Invisibility also end on other targets of the original casting?

My story is written in English, but is set in my home country. What language should I use for the dialogue?

My adviser wants to be the first author

When two POV characters meet

Word for a person who has no opinion about whether god exists

Single word request: Harming the benefactor

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

How does Dispel Magic work against Stoneskin?

What Happens when Passenger Refuses to Fly Boeing 737 Max?

Extension of Splitting Fields over An Arbitrary Field

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?

Question about partial fractions with irreducible quadratic factors



Not able to make the CSS3 animation as continuous



2019 Community Moderator ElectionMake a div fill the height of the remaining screen spaceHow to make div not larger than its contents?How to make a div 100% height of the browser window?How do I combine a background-image and CSS3 gradient on the same element?Make the cursor a hand when a user hovers over a list itemMaintaining the final state at end of a CSS3 animationcss3 :hover animation not working on firefoxCSS3 - Image SlideshowCSS animation rules disappear in Firefox resulting in no animationDraw a vertical line upward with CSS3 SVG animation










0















I am following one blog to understand the CSS3 animations. I wanted to do marquee effect vertically using CSS3. I have followed this example. But the my issue is why there is some delay to restart the animation? When scroll came to down, it is not starting immediately from the top. Some 2,3 seconds of delay is there. How to start the animation from top immediately after the scroll ends. I am attaching gif file here to understand much better.



Code snippet:



<!DOCTYPE html>
<title>Example</title>

<!-- Styles -->
<style>
.example3
height: 200px;
overflow: hidden;
position: relative;

.example3 h3
position: absolute;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
/* Starting position */
-moz-transform:translateY(-100%);
-webkit-transform:translateY(-100%);
transform:translateY(-100%);
/* Apply animation to this element */
-moz-animation: example3 15s linear infinite;
-webkit-animation: example3 15s linear infinite;
animation: example3 15s linear infinite;

/* Move it (define the animation) */
@-moz-keyframes example3
0% -moz-transform: translateY(-100%);
100% -moz-transform: translateY(100%);

@-webkit-keyframes example3
0% -webkit-transform: translateY(-100%);
100% -webkit-transform: translateY(100%);

@keyframes example3
0%
-moz-transform: translateY(-100%); /* Firefox bug fix */
-webkit-transform: translateY(-100%); /* Firefox bug fix */
transform: translateY(-100%);

100%
-moz-transform: translateY(100%); /* Firefox bug fix */
-webkit-transform: translateY(100%); /* Firefox bug fix */
transform: translateY(100%);


</style>

<!-- HTML -->
<div class="example3">
<h3>Scrolling down... </h3>
</div>


enter image description here










share|improve this question




























    0















    I am following one blog to understand the CSS3 animations. I wanted to do marquee effect vertically using CSS3. I have followed this example. But the my issue is why there is some delay to restart the animation? When scroll came to down, it is not starting immediately from the top. Some 2,3 seconds of delay is there. How to start the animation from top immediately after the scroll ends. I am attaching gif file here to understand much better.



    Code snippet:



    <!DOCTYPE html>
    <title>Example</title>

    <!-- Styles -->
    <style>
    .example3
    height: 200px;
    overflow: hidden;
    position: relative;

    .example3 h3
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    line-height: 50px;
    text-align: center;
    /* Starting position */
    -moz-transform:translateY(-100%);
    -webkit-transform:translateY(-100%);
    transform:translateY(-100%);
    /* Apply animation to this element */
    -moz-animation: example3 15s linear infinite;
    -webkit-animation: example3 15s linear infinite;
    animation: example3 15s linear infinite;

    /* Move it (define the animation) */
    @-moz-keyframes example3
    0% -moz-transform: translateY(-100%);
    100% -moz-transform: translateY(100%);

    @-webkit-keyframes example3
    0% -webkit-transform: translateY(-100%);
    100% -webkit-transform: translateY(100%);

    @keyframes example3
    0%
    -moz-transform: translateY(-100%); /* Firefox bug fix */
    -webkit-transform: translateY(-100%); /* Firefox bug fix */
    transform: translateY(-100%);

    100%
    -moz-transform: translateY(100%); /* Firefox bug fix */
    -webkit-transform: translateY(100%); /* Firefox bug fix */
    transform: translateY(100%);


    </style>

    <!-- HTML -->
    <div class="example3">
    <h3>Scrolling down... </h3>
    </div>


    enter image description here










    share|improve this question


























      0












      0








      0








      I am following one blog to understand the CSS3 animations. I wanted to do marquee effect vertically using CSS3. I have followed this example. But the my issue is why there is some delay to restart the animation? When scroll came to down, it is not starting immediately from the top. Some 2,3 seconds of delay is there. How to start the animation from top immediately after the scroll ends. I am attaching gif file here to understand much better.



      Code snippet:



      <!DOCTYPE html>
      <title>Example</title>

      <!-- Styles -->
      <style>
      .example3
      height: 200px;
      overflow: hidden;
      position: relative;

      .example3 h3
      position: absolute;
      width: 100%;
      height: 100%;
      margin: 0;
      line-height: 50px;
      text-align: center;
      /* Starting position */
      -moz-transform:translateY(-100%);
      -webkit-transform:translateY(-100%);
      transform:translateY(-100%);
      /* Apply animation to this element */
      -moz-animation: example3 15s linear infinite;
      -webkit-animation: example3 15s linear infinite;
      animation: example3 15s linear infinite;

      /* Move it (define the animation) */
      @-moz-keyframes example3
      0% -moz-transform: translateY(-100%);
      100% -moz-transform: translateY(100%);

      @-webkit-keyframes example3
      0% -webkit-transform: translateY(-100%);
      100% -webkit-transform: translateY(100%);

      @keyframes example3
      0%
      -moz-transform: translateY(-100%); /* Firefox bug fix */
      -webkit-transform: translateY(-100%); /* Firefox bug fix */
      transform: translateY(-100%);

      100%
      -moz-transform: translateY(100%); /* Firefox bug fix */
      -webkit-transform: translateY(100%); /* Firefox bug fix */
      transform: translateY(100%);


      </style>

      <!-- HTML -->
      <div class="example3">
      <h3>Scrolling down... </h3>
      </div>


      enter image description here










      share|improve this question
















      I am following one blog to understand the CSS3 animations. I wanted to do marquee effect vertically using CSS3. I have followed this example. But the my issue is why there is some delay to restart the animation? When scroll came to down, it is not starting immediately from the top. Some 2,3 seconds of delay is there. How to start the animation from top immediately after the scroll ends. I am attaching gif file here to understand much better.



      Code snippet:



      <!DOCTYPE html>
      <title>Example</title>

      <!-- Styles -->
      <style>
      .example3
      height: 200px;
      overflow: hidden;
      position: relative;

      .example3 h3
      position: absolute;
      width: 100%;
      height: 100%;
      margin: 0;
      line-height: 50px;
      text-align: center;
      /* Starting position */
      -moz-transform:translateY(-100%);
      -webkit-transform:translateY(-100%);
      transform:translateY(-100%);
      /* Apply animation to this element */
      -moz-animation: example3 15s linear infinite;
      -webkit-animation: example3 15s linear infinite;
      animation: example3 15s linear infinite;

      /* Move it (define the animation) */
      @-moz-keyframes example3
      0% -moz-transform: translateY(-100%);
      100% -moz-transform: translateY(100%);

      @-webkit-keyframes example3
      0% -webkit-transform: translateY(-100%);
      100% -webkit-transform: translateY(100%);

      @keyframes example3
      0%
      -moz-transform: translateY(-100%); /* Firefox bug fix */
      -webkit-transform: translateY(-100%); /* Firefox bug fix */
      transform: translateY(-100%);

      100%
      -moz-transform: translateY(100%); /* Firefox bug fix */
      -webkit-transform: translateY(100%); /* Firefox bug fix */
      transform: translateY(100%);


      </style>

      <!-- HTML -->
      <div class="example3">
      <h3>Scrolling down... </h3>
      </div>


      enter image description here







      css css3 css-animations translate-animation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 6 at 18:10







      Mihir

















      asked Mar 6 at 17:21









      MihirMihir

      4,435134880




      4,435134880






















          3 Answers
          3






          active

          oldest

          votes


















          1














          Your animation starting immidiatly, but you are start at position -100%.



          If you want to start from top, then change every keyframes to 0 from -100%.
          If You want to roll down immidiately from top, then try to change it equal with your text line height (-50px).






          <!DOCTYPE html> <title>Example</title>

          <!-- Styles -->
          <style>
          .example3
          height: 200px;
          overflow: hidden;
          position: relative;

          .example3 h3
          position: absolute;
          width: 100%;
          height: 100%;
          margin: 0;
          line-height: 50px;
          text-align: center;
          /* Starting position */
          -moz-transform: translateY(-50px);
          -webkit-transform: translateY(-50px);
          transform: translateY(-50px);
          /* Apply animation to this element */
          -moz-animation: example3 15s linear infinite;
          -webkit-animation: example3 15s linear infinite;
          animation: example3 15s linear infinite;

          /* Move it (define the animation) */
          @-moz-keyframes example3
          0%
          -moz-transform: translateY(-50px);

          100%
          -moz-transform: translateY(100%);


          @-webkit-keyframes example3
          0%
          -webkit-transform: translateY(-50px);

          100%
          -webkit-transform: translateY(100%);


          @keyframes example3
          0%
          -moz-transform: translateY(-50px); /* Firefox bug fix */
          -webkit-transform: translateY(-50px); /* Firefox bug fix */
          transform: translateY(-50px);

          100%
          -moz-transform: translateY(100%); /* Firefox bug fix */
          -webkit-transform: translateY(100%); /* Firefox bug fix */
          transform: translateY(100%);


          </style>

          <!-- HTML -->
          <div class="example3"><h3>Scrolling down...</h3></div>








          share|improve this answer

























          • Still there is some delay between end and start

            – Mihir
            Mar 6 at 19:12


















          1














          You need to reajust the movements.



          I have set 3 examples with the solution that you have: The first position, the second one, and the animation.



          And then, another 3 examples with a possible solution, with the initial state, the final one, and the animation.



          I have removed the overflow: hidden, and colored the element semitransparent, so that it's easily seen what is happening






          .example 
          height: 200px;
          width: 100px;
          position: relative;
          border: solid 1px;
          margin-top: 200px;
          display: inline-block;


          .example h3
          position: absolute;
          width: 100%;
          height: 100%;
          margin: 0;
          line-height: 50px;
          text-align: center;
          background-color: rgba(200, 200, 255, 0.7);


          #ex1 h3
          transform: translateY(-100%);

          #ex2 h3
          transform: translateY(100%);


          #ex3 h3
          animation: example 15s linear infinite;

          @keyframes example
          0%
          transform: translateY(-100%);

          100%
          transform: translateY(100%);


          #ex4 h3
          top: -32px;

          #ex5 h3
          top: -20px;
          transform: translateY(100%);

          #ex6 h3
          animation: example2 15s linear infinite;

          @keyframes example2
          0%
          transform: translateY(-32px);

          100%
          transform: translateY(calc(-20px + 100%));


          <div class="example" id="ex1">
          <h3>Scrolling</h3>
          </div>
          <div class="example" id="ex2">
          <h3>Scrolling</h3>
          </div>
          <div class="example" id="ex3">
          <h3>Scrolling</h3>
          </div>
          <div class="example" id="ex4">
          <h3>Scrolling</h3>
          </div>
          <div class="example" id="ex5">
          <h3>Scrolling</h3>
          </div>
          <div class="example" id="ex6">
          <h3>Scrolling</h3>
          </div>








          share|improve this answer






























            0














            You can achieve this using CSS Position



            By setting the parent container to relative and the child element to absolute, you can get the marquee effect without delays.



            Below is a sample snippet do further demonstrate what do you want to happen in your marquee. Here, we used the position: relative; to the parent class wrap to make the position: absolute; of the marquee element h4 recognize it as its parent.



            Going to the keyframes, we set the position of h4 to top: 0% to make it stick above the container at the start and top: calc(100% - 18px); on its peak.




            Why do we need to use calc() here?




            • Basically adding just 100% to its peak position will overflow the marquee outside the parent element, causing weird behaviour.


            Why calc(100% - 18px)?




            • 18px is the default font size of every text you add into an element, and we set the css of the marquee to padding: 0; and margin: 0 to remove extra spaces inside and outside that makes the marquee looks like we have starting delay because we only see the blank spaces unoccupied by the text inside the marquee;




            .wrap 
            position: relative;
            height: 150px;
            width: 100px;
            background: gray;


            .wrap h4
            text-align: center;
            position: absolute;
            top: 0%;
            left: 0%;
            padding: 0;
            margin: 0;
            background-color: red;
            width: 100%;
            animation: marquee 5s linear infinite;


            @keyframes marquee
            0%
            top: 0%;

            100%
            top: calc(100% - 18px);



            @-moz-keyframes marquee
            0%
            top: 0%;

            100%
            top: calc(100% - 18px);



            @-webkit-keyframes marquee
            0%
            top: 0%;

            100%
            top: calc(100% - 18px);


            <div class="wrap">
            <h4>Oopsie</h4>
            </div>








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



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55028829%2fnot-able-to-make-the-css3-animation-as-continuous%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Your animation starting immidiatly, but you are start at position -100%.



              If you want to start from top, then change every keyframes to 0 from -100%.
              If You want to roll down immidiately from top, then try to change it equal with your text line height (-50px).






              <!DOCTYPE html> <title>Example</title>

              <!-- Styles -->
              <style>
              .example3
              height: 200px;
              overflow: hidden;
              position: relative;

              .example3 h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              /* Starting position */
              -moz-transform: translateY(-50px);
              -webkit-transform: translateY(-50px);
              transform: translateY(-50px);
              /* Apply animation to this element */
              -moz-animation: example3 15s linear infinite;
              -webkit-animation: example3 15s linear infinite;
              animation: example3 15s linear infinite;

              /* Move it (define the animation) */
              @-moz-keyframes example3
              0%
              -moz-transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%);


              @-webkit-keyframes example3
              0%
              -webkit-transform: translateY(-50px);

              100%
              -webkit-transform: translateY(100%);


              @keyframes example3
              0%
              -moz-transform: translateY(-50px); /* Firefox bug fix */
              -webkit-transform: translateY(-50px); /* Firefox bug fix */
              transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%); /* Firefox bug fix */
              -webkit-transform: translateY(100%); /* Firefox bug fix */
              transform: translateY(100%);


              </style>

              <!-- HTML -->
              <div class="example3"><h3>Scrolling down...</h3></div>








              share|improve this answer

























              • Still there is some delay between end and start

                – Mihir
                Mar 6 at 19:12















              1














              Your animation starting immidiatly, but you are start at position -100%.



              If you want to start from top, then change every keyframes to 0 from -100%.
              If You want to roll down immidiately from top, then try to change it equal with your text line height (-50px).






              <!DOCTYPE html> <title>Example</title>

              <!-- Styles -->
              <style>
              .example3
              height: 200px;
              overflow: hidden;
              position: relative;

              .example3 h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              /* Starting position */
              -moz-transform: translateY(-50px);
              -webkit-transform: translateY(-50px);
              transform: translateY(-50px);
              /* Apply animation to this element */
              -moz-animation: example3 15s linear infinite;
              -webkit-animation: example3 15s linear infinite;
              animation: example3 15s linear infinite;

              /* Move it (define the animation) */
              @-moz-keyframes example3
              0%
              -moz-transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%);


              @-webkit-keyframes example3
              0%
              -webkit-transform: translateY(-50px);

              100%
              -webkit-transform: translateY(100%);


              @keyframes example3
              0%
              -moz-transform: translateY(-50px); /* Firefox bug fix */
              -webkit-transform: translateY(-50px); /* Firefox bug fix */
              transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%); /* Firefox bug fix */
              -webkit-transform: translateY(100%); /* Firefox bug fix */
              transform: translateY(100%);


              </style>

              <!-- HTML -->
              <div class="example3"><h3>Scrolling down...</h3></div>








              share|improve this answer

























              • Still there is some delay between end and start

                – Mihir
                Mar 6 at 19:12













              1












              1








              1







              Your animation starting immidiatly, but you are start at position -100%.



              If you want to start from top, then change every keyframes to 0 from -100%.
              If You want to roll down immidiately from top, then try to change it equal with your text line height (-50px).






              <!DOCTYPE html> <title>Example</title>

              <!-- Styles -->
              <style>
              .example3
              height: 200px;
              overflow: hidden;
              position: relative;

              .example3 h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              /* Starting position */
              -moz-transform: translateY(-50px);
              -webkit-transform: translateY(-50px);
              transform: translateY(-50px);
              /* Apply animation to this element */
              -moz-animation: example3 15s linear infinite;
              -webkit-animation: example3 15s linear infinite;
              animation: example3 15s linear infinite;

              /* Move it (define the animation) */
              @-moz-keyframes example3
              0%
              -moz-transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%);


              @-webkit-keyframes example3
              0%
              -webkit-transform: translateY(-50px);

              100%
              -webkit-transform: translateY(100%);


              @keyframes example3
              0%
              -moz-transform: translateY(-50px); /* Firefox bug fix */
              -webkit-transform: translateY(-50px); /* Firefox bug fix */
              transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%); /* Firefox bug fix */
              -webkit-transform: translateY(100%); /* Firefox bug fix */
              transform: translateY(100%);


              </style>

              <!-- HTML -->
              <div class="example3"><h3>Scrolling down...</h3></div>








              share|improve this answer















              Your animation starting immidiatly, but you are start at position -100%.



              If you want to start from top, then change every keyframes to 0 from -100%.
              If You want to roll down immidiately from top, then try to change it equal with your text line height (-50px).






              <!DOCTYPE html> <title>Example</title>

              <!-- Styles -->
              <style>
              .example3
              height: 200px;
              overflow: hidden;
              position: relative;

              .example3 h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              /* Starting position */
              -moz-transform: translateY(-50px);
              -webkit-transform: translateY(-50px);
              transform: translateY(-50px);
              /* Apply animation to this element */
              -moz-animation: example3 15s linear infinite;
              -webkit-animation: example3 15s linear infinite;
              animation: example3 15s linear infinite;

              /* Move it (define the animation) */
              @-moz-keyframes example3
              0%
              -moz-transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%);


              @-webkit-keyframes example3
              0%
              -webkit-transform: translateY(-50px);

              100%
              -webkit-transform: translateY(100%);


              @keyframes example3
              0%
              -moz-transform: translateY(-50px); /* Firefox bug fix */
              -webkit-transform: translateY(-50px); /* Firefox bug fix */
              transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%); /* Firefox bug fix */
              -webkit-transform: translateY(100%); /* Firefox bug fix */
              transform: translateY(100%);


              </style>

              <!-- HTML -->
              <div class="example3"><h3>Scrolling down...</h3></div>








              <!DOCTYPE html> <title>Example</title>

              <!-- Styles -->
              <style>
              .example3
              height: 200px;
              overflow: hidden;
              position: relative;

              .example3 h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              /* Starting position */
              -moz-transform: translateY(-50px);
              -webkit-transform: translateY(-50px);
              transform: translateY(-50px);
              /* Apply animation to this element */
              -moz-animation: example3 15s linear infinite;
              -webkit-animation: example3 15s linear infinite;
              animation: example3 15s linear infinite;

              /* Move it (define the animation) */
              @-moz-keyframes example3
              0%
              -moz-transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%);


              @-webkit-keyframes example3
              0%
              -webkit-transform: translateY(-50px);

              100%
              -webkit-transform: translateY(100%);


              @keyframes example3
              0%
              -moz-transform: translateY(-50px); /* Firefox bug fix */
              -webkit-transform: translateY(-50px); /* Firefox bug fix */
              transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%); /* Firefox bug fix */
              -webkit-transform: translateY(100%); /* Firefox bug fix */
              transform: translateY(100%);


              </style>

              <!-- HTML -->
              <div class="example3"><h3>Scrolling down...</h3></div>





              <!DOCTYPE html> <title>Example</title>

              <!-- Styles -->
              <style>
              .example3
              height: 200px;
              overflow: hidden;
              position: relative;

              .example3 h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              /* Starting position */
              -moz-transform: translateY(-50px);
              -webkit-transform: translateY(-50px);
              transform: translateY(-50px);
              /* Apply animation to this element */
              -moz-animation: example3 15s linear infinite;
              -webkit-animation: example3 15s linear infinite;
              animation: example3 15s linear infinite;

              /* Move it (define the animation) */
              @-moz-keyframes example3
              0%
              -moz-transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%);


              @-webkit-keyframes example3
              0%
              -webkit-transform: translateY(-50px);

              100%
              -webkit-transform: translateY(100%);


              @keyframes example3
              0%
              -moz-transform: translateY(-50px); /* Firefox bug fix */
              -webkit-transform: translateY(-50px); /* Firefox bug fix */
              transform: translateY(-50px);

              100%
              -moz-transform: translateY(100%); /* Firefox bug fix */
              -webkit-transform: translateY(100%); /* Firefox bug fix */
              transform: translateY(100%);


              </style>

              <!-- HTML -->
              <div class="example3"><h3>Scrolling down...</h3></div>






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 6 at 18:46

























              answered Mar 6 at 18:39









              CuCu99CuCu99

              114




              114












              • Still there is some delay between end and start

                – Mihir
                Mar 6 at 19:12

















              • Still there is some delay between end and start

                – Mihir
                Mar 6 at 19:12
















              Still there is some delay between end and start

              – Mihir
              Mar 6 at 19:12





              Still there is some delay between end and start

              – Mihir
              Mar 6 at 19:12













              1














              You need to reajust the movements.



              I have set 3 examples with the solution that you have: The first position, the second one, and the animation.



              And then, another 3 examples with a possible solution, with the initial state, the final one, and the animation.



              I have removed the overflow: hidden, and colored the element semitransparent, so that it's easily seen what is happening






              .example 
              height: 200px;
              width: 100px;
              position: relative;
              border: solid 1px;
              margin-top: 200px;
              display: inline-block;


              .example h3
              position: absolute;
              width: 100%;
              height: 100%;
              margin: 0;
              line-height: 50px;
              text-align: center;
              background-color: rgba(200, 200, 255, 0.7);


              #ex1 h3
              transform: translateY(-100%);

              #ex2 h3
              transform: translateY(100%);


              #ex3 h3
              animation: example 15s linear infinite;

              @keyframes example
              0%
              transform: translateY(-100%);

              100%
              transform: translateY(100%);


              #ex4 h3
              top: -32px;

              #ex5 h3
              top: -20px;
              transform: translateY(100%);

              #ex6 h3
              animation: example2 15s linear infinite;

              @keyframes example2
              0%
              transform: translateY(-32px);

              100%
              transform: translateY(calc(-20px + 100%));


              <div class="example" id="ex1">
              <h3>Scrolling</h3>
              </div>
              <div class="example" id="ex2">
              <h3>Scrolling</h3>
              </div>
              <div class="example" id="ex3">
              <h3>Scrolling</h3>
              </div>
              <div class="example" id="ex4">
              <h3>Scrolling</h3>
              </div>
              <div class="example" id="ex5">
              <h3>Scrolling</h3>
              </div>
              <div class="example" id="ex6">
              <h3>Scrolling</h3>
              </div>








              share|improve this answer



























                1














                You need to reajust the movements.



                I have set 3 examples with the solution that you have: The first position, the second one, and the animation.



                And then, another 3 examples with a possible solution, with the initial state, the final one, and the animation.



                I have removed the overflow: hidden, and colored the element semitransparent, so that it's easily seen what is happening






                .example 
                height: 200px;
                width: 100px;
                position: relative;
                border: solid 1px;
                margin-top: 200px;
                display: inline-block;


                .example h3
                position: absolute;
                width: 100%;
                height: 100%;
                margin: 0;
                line-height: 50px;
                text-align: center;
                background-color: rgba(200, 200, 255, 0.7);


                #ex1 h3
                transform: translateY(-100%);

                #ex2 h3
                transform: translateY(100%);


                #ex3 h3
                animation: example 15s linear infinite;

                @keyframes example
                0%
                transform: translateY(-100%);

                100%
                transform: translateY(100%);


                #ex4 h3
                top: -32px;

                #ex5 h3
                top: -20px;
                transform: translateY(100%);

                #ex6 h3
                animation: example2 15s linear infinite;

                @keyframes example2
                0%
                transform: translateY(-32px);

                100%
                transform: translateY(calc(-20px + 100%));


                <div class="example" id="ex1">
                <h3>Scrolling</h3>
                </div>
                <div class="example" id="ex2">
                <h3>Scrolling</h3>
                </div>
                <div class="example" id="ex3">
                <h3>Scrolling</h3>
                </div>
                <div class="example" id="ex4">
                <h3>Scrolling</h3>
                </div>
                <div class="example" id="ex5">
                <h3>Scrolling</h3>
                </div>
                <div class="example" id="ex6">
                <h3>Scrolling</h3>
                </div>








                share|improve this answer

























                  1












                  1








                  1







                  You need to reajust the movements.



                  I have set 3 examples with the solution that you have: The first position, the second one, and the animation.



                  And then, another 3 examples with a possible solution, with the initial state, the final one, and the animation.



                  I have removed the overflow: hidden, and colored the element semitransparent, so that it's easily seen what is happening






                  .example 
                  height: 200px;
                  width: 100px;
                  position: relative;
                  border: solid 1px;
                  margin-top: 200px;
                  display: inline-block;


                  .example h3
                  position: absolute;
                  width: 100%;
                  height: 100%;
                  margin: 0;
                  line-height: 50px;
                  text-align: center;
                  background-color: rgba(200, 200, 255, 0.7);


                  #ex1 h3
                  transform: translateY(-100%);

                  #ex2 h3
                  transform: translateY(100%);


                  #ex3 h3
                  animation: example 15s linear infinite;

                  @keyframes example
                  0%
                  transform: translateY(-100%);

                  100%
                  transform: translateY(100%);


                  #ex4 h3
                  top: -32px;

                  #ex5 h3
                  top: -20px;
                  transform: translateY(100%);

                  #ex6 h3
                  animation: example2 15s linear infinite;

                  @keyframes example2
                  0%
                  transform: translateY(-32px);

                  100%
                  transform: translateY(calc(-20px + 100%));


                  <div class="example" id="ex1">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex2">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex3">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex4">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex5">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex6">
                  <h3>Scrolling</h3>
                  </div>








                  share|improve this answer













                  You need to reajust the movements.



                  I have set 3 examples with the solution that you have: The first position, the second one, and the animation.



                  And then, another 3 examples with a possible solution, with the initial state, the final one, and the animation.



                  I have removed the overflow: hidden, and colored the element semitransparent, so that it's easily seen what is happening






                  .example 
                  height: 200px;
                  width: 100px;
                  position: relative;
                  border: solid 1px;
                  margin-top: 200px;
                  display: inline-block;


                  .example h3
                  position: absolute;
                  width: 100%;
                  height: 100%;
                  margin: 0;
                  line-height: 50px;
                  text-align: center;
                  background-color: rgba(200, 200, 255, 0.7);


                  #ex1 h3
                  transform: translateY(-100%);

                  #ex2 h3
                  transform: translateY(100%);


                  #ex3 h3
                  animation: example 15s linear infinite;

                  @keyframes example
                  0%
                  transform: translateY(-100%);

                  100%
                  transform: translateY(100%);


                  #ex4 h3
                  top: -32px;

                  #ex5 h3
                  top: -20px;
                  transform: translateY(100%);

                  #ex6 h3
                  animation: example2 15s linear infinite;

                  @keyframes example2
                  0%
                  transform: translateY(-32px);

                  100%
                  transform: translateY(calc(-20px + 100%));


                  <div class="example" id="ex1">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex2">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex3">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex4">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex5">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex6">
                  <h3>Scrolling</h3>
                  </div>








                  .example 
                  height: 200px;
                  width: 100px;
                  position: relative;
                  border: solid 1px;
                  margin-top: 200px;
                  display: inline-block;


                  .example h3
                  position: absolute;
                  width: 100%;
                  height: 100%;
                  margin: 0;
                  line-height: 50px;
                  text-align: center;
                  background-color: rgba(200, 200, 255, 0.7);


                  #ex1 h3
                  transform: translateY(-100%);

                  #ex2 h3
                  transform: translateY(100%);


                  #ex3 h3
                  animation: example 15s linear infinite;

                  @keyframes example
                  0%
                  transform: translateY(-100%);

                  100%
                  transform: translateY(100%);


                  #ex4 h3
                  top: -32px;

                  #ex5 h3
                  top: -20px;
                  transform: translateY(100%);

                  #ex6 h3
                  animation: example2 15s linear infinite;

                  @keyframes example2
                  0%
                  transform: translateY(-32px);

                  100%
                  transform: translateY(calc(-20px + 100%));


                  <div class="example" id="ex1">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex2">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex3">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex4">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex5">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex6">
                  <h3>Scrolling</h3>
                  </div>





                  .example 
                  height: 200px;
                  width: 100px;
                  position: relative;
                  border: solid 1px;
                  margin-top: 200px;
                  display: inline-block;


                  .example h3
                  position: absolute;
                  width: 100%;
                  height: 100%;
                  margin: 0;
                  line-height: 50px;
                  text-align: center;
                  background-color: rgba(200, 200, 255, 0.7);


                  #ex1 h3
                  transform: translateY(-100%);

                  #ex2 h3
                  transform: translateY(100%);


                  #ex3 h3
                  animation: example 15s linear infinite;

                  @keyframes example
                  0%
                  transform: translateY(-100%);

                  100%
                  transform: translateY(100%);


                  #ex4 h3
                  top: -32px;

                  #ex5 h3
                  top: -20px;
                  transform: translateY(100%);

                  #ex6 h3
                  animation: example2 15s linear infinite;

                  @keyframes example2
                  0%
                  transform: translateY(-32px);

                  100%
                  transform: translateY(calc(-20px + 100%));


                  <div class="example" id="ex1">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex2">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex3">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex4">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex5">
                  <h3>Scrolling</h3>
                  </div>
                  <div class="example" id="ex6">
                  <h3>Scrolling</h3>
                  </div>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 6 at 20:56









                  valsvals

                  45.7k857109




                  45.7k857109





















                      0














                      You can achieve this using CSS Position



                      By setting the parent container to relative and the child element to absolute, you can get the marquee effect without delays.



                      Below is a sample snippet do further demonstrate what do you want to happen in your marquee. Here, we used the position: relative; to the parent class wrap to make the position: absolute; of the marquee element h4 recognize it as its parent.



                      Going to the keyframes, we set the position of h4 to top: 0% to make it stick above the container at the start and top: calc(100% - 18px); on its peak.




                      Why do we need to use calc() here?




                      • Basically adding just 100% to its peak position will overflow the marquee outside the parent element, causing weird behaviour.


                      Why calc(100% - 18px)?




                      • 18px is the default font size of every text you add into an element, and we set the css of the marquee to padding: 0; and margin: 0 to remove extra spaces inside and outside that makes the marquee looks like we have starting delay because we only see the blank spaces unoccupied by the text inside the marquee;




                      .wrap 
                      position: relative;
                      height: 150px;
                      width: 100px;
                      background: gray;


                      .wrap h4
                      text-align: center;
                      position: absolute;
                      top: 0%;
                      left: 0%;
                      padding: 0;
                      margin: 0;
                      background-color: red;
                      width: 100%;
                      animation: marquee 5s linear infinite;


                      @keyframes marquee
                      0%
                      top: 0%;

                      100%
                      top: calc(100% - 18px);



                      @-moz-keyframes marquee
                      0%
                      top: 0%;

                      100%
                      top: calc(100% - 18px);



                      @-webkit-keyframes marquee
                      0%
                      top: 0%;

                      100%
                      top: calc(100% - 18px);


                      <div class="wrap">
                      <h4>Oopsie</h4>
                      </div>








                      share|improve this answer





























                        0














                        You can achieve this using CSS Position



                        By setting the parent container to relative and the child element to absolute, you can get the marquee effect without delays.



                        Below is a sample snippet do further demonstrate what do you want to happen in your marquee. Here, we used the position: relative; to the parent class wrap to make the position: absolute; of the marquee element h4 recognize it as its parent.



                        Going to the keyframes, we set the position of h4 to top: 0% to make it stick above the container at the start and top: calc(100% - 18px); on its peak.




                        Why do we need to use calc() here?




                        • Basically adding just 100% to its peak position will overflow the marquee outside the parent element, causing weird behaviour.


                        Why calc(100% - 18px)?




                        • 18px is the default font size of every text you add into an element, and we set the css of the marquee to padding: 0; and margin: 0 to remove extra spaces inside and outside that makes the marquee looks like we have starting delay because we only see the blank spaces unoccupied by the text inside the marquee;




                        .wrap 
                        position: relative;
                        height: 150px;
                        width: 100px;
                        background: gray;


                        .wrap h4
                        text-align: center;
                        position: absolute;
                        top: 0%;
                        left: 0%;
                        padding: 0;
                        margin: 0;
                        background-color: red;
                        width: 100%;
                        animation: marquee 5s linear infinite;


                        @keyframes marquee
                        0%
                        top: 0%;

                        100%
                        top: calc(100% - 18px);



                        @-moz-keyframes marquee
                        0%
                        top: 0%;

                        100%
                        top: calc(100% - 18px);



                        @-webkit-keyframes marquee
                        0%
                        top: 0%;

                        100%
                        top: calc(100% - 18px);


                        <div class="wrap">
                        <h4>Oopsie</h4>
                        </div>








                        share|improve this answer



























                          0












                          0








                          0







                          You can achieve this using CSS Position



                          By setting the parent container to relative and the child element to absolute, you can get the marquee effect without delays.



                          Below is a sample snippet do further demonstrate what do you want to happen in your marquee. Here, we used the position: relative; to the parent class wrap to make the position: absolute; of the marquee element h4 recognize it as its parent.



                          Going to the keyframes, we set the position of h4 to top: 0% to make it stick above the container at the start and top: calc(100% - 18px); on its peak.




                          Why do we need to use calc() here?




                          • Basically adding just 100% to its peak position will overflow the marquee outside the parent element, causing weird behaviour.


                          Why calc(100% - 18px)?




                          • 18px is the default font size of every text you add into an element, and we set the css of the marquee to padding: 0; and margin: 0 to remove extra spaces inside and outside that makes the marquee looks like we have starting delay because we only see the blank spaces unoccupied by the text inside the marquee;




                          .wrap 
                          position: relative;
                          height: 150px;
                          width: 100px;
                          background: gray;


                          .wrap h4
                          text-align: center;
                          position: absolute;
                          top: 0%;
                          left: 0%;
                          padding: 0;
                          margin: 0;
                          background-color: red;
                          width: 100%;
                          animation: marquee 5s linear infinite;


                          @keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-moz-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-webkit-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);


                          <div class="wrap">
                          <h4>Oopsie</h4>
                          </div>








                          share|improve this answer















                          You can achieve this using CSS Position



                          By setting the parent container to relative and the child element to absolute, you can get the marquee effect without delays.



                          Below is a sample snippet do further demonstrate what do you want to happen in your marquee. Here, we used the position: relative; to the parent class wrap to make the position: absolute; of the marquee element h4 recognize it as its parent.



                          Going to the keyframes, we set the position of h4 to top: 0% to make it stick above the container at the start and top: calc(100% - 18px); on its peak.




                          Why do we need to use calc() here?




                          • Basically adding just 100% to its peak position will overflow the marquee outside the parent element, causing weird behaviour.


                          Why calc(100% - 18px)?




                          • 18px is the default font size of every text you add into an element, and we set the css of the marquee to padding: 0; and margin: 0 to remove extra spaces inside and outside that makes the marquee looks like we have starting delay because we only see the blank spaces unoccupied by the text inside the marquee;




                          .wrap 
                          position: relative;
                          height: 150px;
                          width: 100px;
                          background: gray;


                          .wrap h4
                          text-align: center;
                          position: absolute;
                          top: 0%;
                          left: 0%;
                          padding: 0;
                          margin: 0;
                          background-color: red;
                          width: 100%;
                          animation: marquee 5s linear infinite;


                          @keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-moz-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-webkit-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);


                          <div class="wrap">
                          <h4>Oopsie</h4>
                          </div>








                          .wrap 
                          position: relative;
                          height: 150px;
                          width: 100px;
                          background: gray;


                          .wrap h4
                          text-align: center;
                          position: absolute;
                          top: 0%;
                          left: 0%;
                          padding: 0;
                          margin: 0;
                          background-color: red;
                          width: 100%;
                          animation: marquee 5s linear infinite;


                          @keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-moz-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-webkit-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);


                          <div class="wrap">
                          <h4>Oopsie</h4>
                          </div>





                          .wrap 
                          position: relative;
                          height: 150px;
                          width: 100px;
                          background: gray;


                          .wrap h4
                          text-align: center;
                          position: absolute;
                          top: 0%;
                          left: 0%;
                          padding: 0;
                          margin: 0;
                          background-color: red;
                          width: 100%;
                          animation: marquee 5s linear infinite;


                          @keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-moz-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);



                          @-webkit-keyframes marquee
                          0%
                          top: 0%;

                          100%
                          top: calc(100% - 18px);


                          <div class="wrap">
                          <h4>Oopsie</h4>
                          </div>






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 8 at 1:31

























                          answered Mar 7 at 3:30









                          The Terrible ChildThe Terrible Child

                          1036




                          1036



























                              draft saved

                              draft discarded
















































                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55028829%2fnot-able-to-make-the-css3-animation-as-continuous%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

                              Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                              Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                              Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved