I can't seem to get the text-decoration attribute to work in my style sheet.
I want to make the selected text blink but it won't work. This is what it looks like:
H1{font-family:arial, times new roman;
font-size:30pt;
color:blue;
text-align:center;
text-decoration:blink;}
Could anyone tell me whats wrong?
NinaAccording to <!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS21/text.html#lining-striking-props:blink">http://www.w3.org/TR/CSS21/text.html#li ... rops:blink</a><!-- m -->
Text blinks (alternates between visible and invisible). Conforming user agents may simply not blink the text. Note that not blinking the text is one technique to satisfy checkpoint 3.3 of WAI-UAAG.According to almost every person who browses the web:Blinking text sucks...According to almost every person who browses the web: Blinking text sucks
And thus my sig. I have a LEGIT reason for wanting to use the blink tag. Will anyone exlpain?
NinaI don't know what to tell you. I just gave it a try, and it blinked in firefox but not in IE6. Your code isn't wrong but, as I posted earlier, some browsers ignore the text-decoration:blink style.To get IE and FF to blink text you could use the <blink> tag but it would be invalid and bring up accessability issues. I think a better method would be to use Javascript and thus give visitors the option to turn off the irritation.
Out of interest, what is your legimate reason?<blink> does not work in IE, only a JavaScript can do it.Here, blink all you want<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var blnkIds=new Array();
var blinkTimer=null;
function blink() {
for(var i=0; i<blnkIds.length; i++) {
var elem=document.getElementById(blnkIds);
if(elem.style.visibility=="visible") elem.style.visibility="hidden";
else elem.style.visibility="visible";
}
}
function toggleBlink() {
if(blinkTimer==null) {
blinkTimer=setInterval("blink()", 500);
document.getElementById("control").firstChild.data="Stop the madness!";
} else {
clearTimeout(blinkTimer);
document.getElementById("control").firstChild.data="Start the madness!";
for(var i=0; i<blnkIds.length; i++) {
document.getElementById(blnkIds).style.visibility="visible";
}
blinkTimer=null;
}
}
onload=function() {
blnkIds.push("blnk1");
blnkIds.push("blnk2");
blinkTimer=setInterval("blink()", 500);
}
</script>
</head>
<body>
<div><a id="control" href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="toggleBlink();">Stop the madness!</a></div>
<h1 id="blnk1">am i blinking?</h1>
<div id="blnk2">i wanna blink too!</div>
</body>
</html>Create an animated graphic of the text that blinks and place it where you need it in the document, being sure to use the alt="..." attribute in the image tag for text-only browsers.
I want to make the selected text blink but it won't work. This is what it looks like:
H1{font-family:arial, times new roman;
font-size:30pt;
color:blue;
text-align:center;
text-decoration:blink;}
Could anyone tell me whats wrong?
NinaAccording to <!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS21/text.html#lining-striking-props:blink">http://www.w3.org/TR/CSS21/text.html#li ... rops:blink</a><!-- m -->
Text blinks (alternates between visible and invisible). Conforming user agents may simply not blink the text. Note that not blinking the text is one technique to satisfy checkpoint 3.3 of WAI-UAAG.According to almost every person who browses the web:Blinking text sucks...According to almost every person who browses the web: Blinking text sucks
And thus my sig. I have a LEGIT reason for wanting to use the blink tag. Will anyone exlpain?
NinaI don't know what to tell you. I just gave it a try, and it blinked in firefox but not in IE6. Your code isn't wrong but, as I posted earlier, some browsers ignore the text-decoration:blink style.To get IE and FF to blink text you could use the <blink> tag but it would be invalid and bring up accessability issues. I think a better method would be to use Javascript and thus give visitors the option to turn off the irritation.
Out of interest, what is your legimate reason?<blink> does not work in IE, only a JavaScript can do it.Here, blink all you want<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var blnkIds=new Array();
var blinkTimer=null;
function blink() {
for(var i=0; i<blnkIds.length; i++) {
var elem=document.getElementById(blnkIds);
if(elem.style.visibility=="visible") elem.style.visibility="hidden";
else elem.style.visibility="visible";
}
}
function toggleBlink() {
if(blinkTimer==null) {
blinkTimer=setInterval("blink()", 500);
document.getElementById("control").firstChild.data="Stop the madness!";
} else {
clearTimeout(blinkTimer);
document.getElementById("control").firstChild.data="Start the madness!";
for(var i=0; i<blnkIds.length; i++) {
document.getElementById(blnkIds).style.visibility="visible";
}
blinkTimer=null;
}
}
onload=function() {
blnkIds.push("blnk1");
blnkIds.push("blnk2");
blinkTimer=setInterval("blink()", 500);
}
</script>
</head>
<body>
<div><a id="control" href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="toggleBlink();">Stop the madness!</a></div>
<h1 id="blnk1">am i blinking?</h1>
<div id="blnk2">i wanna blink too!</div>
</body>
</html>Create an animated graphic of the text that blinks and place it where you need it in the document, being sure to use the alt="..." attribute in the image tag for text-only browsers.