After stumbling upon information about deprecated CSS expressions and how they should not be used, I became intrigued. I came across a code snippet that could keep a floating element in place on the screen even while scrolling.
<html>
<style>
#fixed {
position:absolute;
left:10px;
top:expression(body.scrollTop + 50 + "px");
background:white;
border:1px solid red;}
</style>
<body>
<p id="fixed">Here is some text, which is fixed.</p>
<p>
[many times: "stuff <br/>"]
</p>
</body>
</html>
This functionality reminded me of websites with persistent "share bars" and content at the bottom of their pages.
So...
- Could this be how those sites achieve it?
- Is using Expressions in this scenario acceptable?
- If not, what alternative should be considered?
- Are there any other useful or interesting applications for CSS expressions?