Forum Moderators: open

Message Too Old, No Replies

Environmental Variables in HTML

There's At Least One

         

inuwolf

10:32 pm on Feb 26, 2006 (gmt 0)

10+ Year Member



Before I got into PHP I remember remedying a CSS problem with the following little HTML trick which I found online:

<![if IE 6]>
<link rel="stylesheet" type="text/css" href="layout_ie.css" />
<![endif]>
<![if!IE 6]>
<link rel="stylesheet" type="text/css" href="layout.css" />
<![endif]>

Since that time I've learned--and loved--PHP and its environmental variables. I never knew HTML had them, but the script above convinces me environmental variables can be used outside of server-side languages, even if that's not what they're called. So here's my question:

Does HTML have any other variables like this one? What are they called? How do they work? As a server-side scripter recently returning to web design I find this very interesting.

Robin_reala

11:13 pm on Feb 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No - this is IE's conditional comments. They're proprietary to IE, but can be used in a useful way.

inuwolf

1:13 am on Feb 27, 2006 (gmt 0)

10+ Year Member



So I guess it's less a variable than a conditional statement that speaks to the browser. Are you sure it's proprietary to IE; that it can't speak to other browsers as well? Also, does HTML have anything else like this?