www.webdeveloper.com
Results 1 to 6 of 6

Thread: "flashing" text

  1. #1
    Join Date
    Dec 2002
    Posts
    55

    "flashing" text

    Is it possible, using css, to make text look like it's flashing?
    Maybe having 2 colors changing on and off in a second, or something like that?
    Thanks

    if its not possible in css, other ways? java script not prefered.

  2. #2
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    To my knowledge the best (at least at the moment) CSS can do is:

    Code:
    <span style="text-decoration: blink;">Blinking Text</span>
    But that doesn't work in IE. I think you'd have to use a JavaScript to do that.

    Code:
    <body onload="changeColour('blinky');">
      <script type="text/javascript"><!--
      function changeColour(elementId) {
        var interval = 500;
        var colour1 = "#ff00ff", colour2 = "black";
        if (document.getElementById) {
          var element = document.getElementById(elementId);
          element.style.color = (element.style.color == colour1) ? colour2 : colour1;
          setTimeout("changeColour('" + elementId + "')", interval);
        }
      }
      //--></script>
      <p id="blinky">This should change colour</p>

  3. #3
    Join Date
    Dec 2002
    Location
    Perth, Western Australia
    Posts
    55
    There is a splendid page by one of the forefront runners of the Open Source movement Eric S. Raymond
    http://www.tuxedo.org/~esr/html-hell.html
    It addresses blinking text right up in the first paragraph.

    Listen to wisdom

  4. #4
    Join Date
    Dec 2002
    Posts
    55
    lol, king pellinore...i went to that link and well... i agree to some extent...but the way i'm going to use blinking on my page is very effecite, and how imussing it, every 2 secs., and from dark gray to light gray is really not that annoying, it only gives the user a hint to look that way... thanks for your reply anyways.

  5. #5
    Join Date
    Nov 2002
    Posts
    984

    Re: "flashing" text

    Originally posted by minulescu
    Is it possible, using css, to make text look like it's flashing?
    Maybe having 2 colors changing on and off in a second, or something like that?
    Thanks

    if its not possible in css, other ways? java script not prefered.
    You could do it in CSS by repeating the same text twice in different colors placed on top of each other and having the top one blink.

    Personally I'd advice against using it though, becuse blink IMO sucks

  6. #6
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    I'd agree with Stefan that blinking text sucks. I think it is a very tacky addition to a page. I can think of only a small handful of uses for it, and I doubt that it would look good in many of those.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles