On Thursday 2011-10-20 20:09 -0700, Elli Vizcaino wrote:
> The photoshop analogy helps me get it but then I guess I must be
> misunderstanding the meaning of inheritance, can you tell me what
> exactly does the definition of inherit mean?

It means that the value of the property gets copied from the parent
element to its children, unless those children have another value
specified.  Classic examples of inherited properties are 'color' and
the 'font-*' properties; a classic examples of non-inherited
properties are the 'border-*' properties (since if you give an
element a border, all of its descendants don't also get a border).

You can tell that opacity is not inherited because if you do:
  <div style="opacity: 0.5"><div style="opacity: 0.5">hello</div></div>
you'll get a different effect from:
  <div style="opacity: 0.5"><div>hello</div></div>

(In a similar way, background properties are not inherited, but the
background does end up going behind descendants.  However, if you
have a background-image with some transparency, or a background
image where you can see where the tiles start and end, you'll see
that specifying the background on a child actually adds an
additional background.)

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to