Re: Style sheet misuse advice -Reply

On Jan 28, 10:13am, Charles Peyton Taylor wrote:

> I've never understood why the background property
> doesn't inherit. I'm sure there must be a reason, but
> I really can't think of any.

Let's suppose that background does inherit.

We have this fragment:

<style>
body { background: url(tile.jpg)}
p    { margin-left: 40px }
</style>

<body>
<p>lots of stuff [...] </p>
</body>

So the body - the canvas, essentially - is laid out with tile.jpg
tiled over the whole thing. Then, 40pixels in from the left, the P
starts and this also - because we suppose background inherits - has
a tiled background with the same image but the origin is now the top
left corner of the P

 +==================================
 | origin for body | next tile  ...
 |                 |
 |  +------------------------------
 |  | origin for P    | next tile

It is possible but unlikely that the tiles will line up on the
two elements.

As it stands, though, background does not inherit and the default is
transparent, allowing the background of the parent to show through
so there are no alignment problems.


-- 
Chris Lilley, W3C                          [ http://www.w3.org/ ]
Graphics and Fonts Guy            The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)4 93 65 79 87       06902 Sophia Antipolis Cedex, France

Received on Tuesday, 28 January 1997 15:33:45 UTC