[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Use of variables in HTML



On Fri, 2003-04-04 at 22:24, Kent West wrote:
> Is there a way to use straight HTML or CSS (no perl, php, javascript,
> cgi) to create a web page that has variables in it, like so:

sort of.  you can't substitute straight text, to the best of my
knowledge, but you can do images. i'm not sure if this is at all
helpful, but you can do something like this:


<html>
<head>
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<p>The winner is <span id="winner">&nbsp;</span> and the loser is <span
id="loser">&nbsp;</span></p>
</body>
</html>

and then in "style.css" you do something like this:

#winner {
	height: 20px;
	width: 100px;
	background-image: url("dilbert.gif");
}

#winner {
	height: 20px;
	width: 100px;
	background-image: url("dogbert.gif");
}


javascript could also do it, and javascript is run entirely on the
client end, so it's more like css/html than perl/php/CGI, but this is (i
believe) the only way to do something like that in straight html/css.

-- 
Fred Smith <fps@dividedsky.net>
Divided Sky Internet



Reply to: