untitled

(John Hannent) #1
div.maintext {position: absolute; z-index: 2; opacity: 0.5;
background-color: darkkhaki; top: 55;left: 100px;
height: 75%; width: 75%;}

Internet Explorer doesn’t yet know how to handle the opacityproperty,
but it does have a proprietary opacity filter. To get the same effect in IE,
use this code:

div.maintext {position: absolute; z-index: 2;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
background-color: darkkhaki; top: 55;left: 100px;
height: 75%; width: 75%;}

Notice that IE uses the sensible value 50 for 50 percent (that’s the way most
people would express the degree of transparency). Unfortunately, the CSS
recommendation employs the less intuitive 0.5value for 50 percent. This
isn’t to say that Microsoft always makes sensible decisions, but they did in
this case.

In general, if you’re looking to try out the latest CSS features, you’ll find that
Mozilla and its relative, Firefox, are the most experimental and au courantof
the various browsers. Internet Explorer is a bit more conservative, although
it has many features that other browsers do not (including proprietary
Microsoft extensions such as filters).

Discovering False Pseudo-Classes ............................................................


I call them false pseudo because the double-negative applies. These are true
classes. They’re not fake. They often do a useful job. So, what are these
“pseudo” classes?

To understand the idea of pseudo-classes, first review what a CSS class is:
It’s a way to modify a selector, like an imgselector. The class name acts as an
adjective. Imagine that you want some of the images in your site to be framed
in blue. (If you wanted all the images thus framed, you could just define a
style for the imgselector, without having to create a class. That way, all
images would get the blue frame.) But you want only some images framed. So
you create a class. It’s as if you make up a new category of image that you
decide to identify as the framed image. So the word framedis the name of the
class. You can use any word to name a class that makes sense to you, but
framed makes sense to me here.

You can, of course, create any class you want by merely making up a name
for your class, like this:

Chapter 15: CSS Moves into the Future 269

Free download pdf