Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS css animation of after and before

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34529
    cang_nduc
    Member

    hi all, im wondering is it possible to animate the “content” of an div:after or div:before. Ex: 0% {content:”test”;} 100% {content:”change”;}
    if not, is there anyway to animate text using javascript, please give me an example
    thanks all

    #88072
    BoringCode
    Member

    It is not possible in all the browsers except for Firefox. Correct me if I’m wrong :)

    #88087
    denniscohn
    Member

    Yes…. it’s only possible with Firefox .

    #88090
    cang_nduc
    Member

    can u make an example of it on http://jsfiddle.net,

    #88127
    cang_nduc
    Member

    @cnwtx: sorry for my bad explain but i want to ask if the text content can be change? from “a” to “b” by 1second, for example.

    #88151
    standuncan
    Member

    Well I’m not for sure if I get what you’re asking for, but I think if you just want you content to switch, you could do that several ways. But when are you looking for this content to change? When on hover? If so I would use some CSS integrated content like div {content:”a”;} div:hover {content:”b”;}.

    or you could just have two divs < div id="normal">a< /div> and then < div id="hover">b< /div> and then display div:hover to none then on hover you could display the div:hover to block and the normal div to none. If that makes sense?

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.