I've just learned how to make a text to blink (<div style="text-decoration:blink">text</div>
).
How about the other decoration modes such as color changing? Are they available in CSS?
Thanks.
I've just learned how to make a text to blink (<div style="text-decoration:blink">text</div>
).
How about the other decoration modes such as color changing? Are they available in CSS?
Thanks.
No, these are generally programmed using JavaScript.
If you are referring to link color changing on hover, that is done with css.
a:link { color: blue; }
a:hover { color: green; }
Nothing too interesting with text-decoration. A good resource is always the w3:
http://www.w3schools.com/Css/pr_text_text-decoration.asp
h1 {text-decoration:overline}
h2 {text-decoration:line-through}
h3 {text-decoration:underline}
h4 {text-decoration:blink}
Regarding your second question - of course. CSS can (and should) be used to style almost anything, though blinking text is an extreme example, most rules are much more useful.
Yes, color changing is available in CSS. Use
<div style="color:red">foo</div>
for example. You probably want to check out a good CSS introduction or the official standard:
The available text-decoration values are:
See http://reference.sitepoint.com/css/text-decoration for more details.
Yes, you can use the following:
color: #FFFFFF;
(which would make your text white in color)
font-weight:bold;
text-decoration:underline;
etc.
You should really Google this.
I suppose that by color changing you don’t mean just to set the text color as color
does but more complex animations.
There are some experiments like WebKit’s -webkit-animation
, -webkit-transform
or -webkit-transition
. But those properties are proprietary.
Nowadays such effects are done with the help of JavaScript. There are plenty JavaScript frameworks you can use like jQuery, mootools, Prototype, Script.aculo.us, etc.