mozilla

Compare Revisions

inheritance

Change Revisions

Revision 342755:

Revision 342755 by shitface on

Revision 342841:

Revision 342841 by teoli on

Title:
inheritance
inheritance
Slug:
CSS/inheritance
CSS/inheritance
Tags:
"css", "CSS Reference"
"css", "CSS Reference"
Content:

Revision 342755
Revision 342841
n8      <code>Summary</code>n8      Summary
n10    <h2 id="The_summary_of_every_CSS_property_definition_says_when10    <p>
>ther_that_property_is_inherited_by_default_(.22Inherited.3A_Yes.2 
>2)_or_not_inherited_by_default_(.22Inherited.3A_no.22)._This_cont 
>rols_what_happens_when_no_value_is_specified_for_a_property_on_an 
>_element."> 
n12    </h2>n12    </p>
n16    <div class="note">n16    <p>
17      <h2 id="When_no_value_for_an_inherited_property_has_been_sp
>ecified_on_an_element.2C_the_element_gets_the_computed_value_of_t 
>hat_property_on_its_parent_element._Only_the_root_element_of_the_ 
>document_gets_the_initial_value_given_in_the_property's_summary." 
>> 
18        When no value for an <strong>inherited property</strong> 17      When no value for an <strong>inherited property</strong> ha
>has been specified on an element, the element gets the <strike><a>s been specified on an element, the element gets the <a href="/en
> href="/en-US/docs/CSS/computed_value" title="en/CSS/computed_val>-US/docs/CSS/computed_value" title="en/CSS/computed_value">comput
>ue">computed value</a></strike> of that property on its parent el>ed value</a> of that property on its parent element. Only the roo
>ement. Only the root element of the document gets the <a href="/e>t element of the document gets the <a href="/en-US/docs/CSS/initi
>n-US/docs/CSS/initial_value" title="en/CSS/initial_value">initial>al_value" title="en/CSS/initial_value">initial value</a> given in
> value</a> given in the property's summary.> the property's summary.
19      </h2>
20    </div>18    </p>
21    <h2 id="A_typical_example_of_an_inherited_property_is_the_.7B19    <p>
>.7B_Cssxref(.22color.22)_.7D.7D_property._Given_the_style_rules.3 
>A"> 
n23    </h2>n21    </p>
24    <h2 class="brush: css" id="p_.7B_color.3A_green_.7D">22    <pre class="brush: css">
25      p { color: green }23p { color: green }
24</pre>
26    </h2>25    <p>
27    <h2 id="and_the_markup.3A">
n29    </h2>n27    </p>
30    <h2 class="brush: html" id="&lt;p&gt;This_paragraph_has_&lt;e28    <pre class="brush: html">
>m&gt;emphasized_text&lt;.2Fem&gt;_in_it.&lt;.2Fp&gt;"> 
31      &lt;p&gt;This paragraph has &lt;em&gt;emphasized text&lt;/e29&lt;p&gt;This paragraph has &lt;em&gt;emphasized text&lt;/em&gt; 
>m&gt; in it.&lt;/p&gt;>in it.&lt;/p&gt;
30</pre>
32    </h2>31    <p>
33    <h2 id="the_words_.22emphasized_text.22_will_appear_green.2C_
>since_the_em_element_has_inherited_the_value_of_the_.7B.7B_Cssxre 
>f(.22color.22)_.7D.7D_property_from_the_p_element._It_does_not_ge 
>t_the_initial_value_of_the_property_(which_is_the_color_that_is_u 
>sed_for_the_root_element_when_the_page_specifies_no_color)."> 
n35    </h2>n33    </p>
n39    <h2 id="When_no_value_for_an_non-inherited_property_(sometimen37    <p>
>s_called_a_reset_property_in_Mozilla_code)_has_been_specified_on_ 
>an_element.2C_the_element_gets_the_initial_value_of_that_property 
>_(as_specified_in_the_property's_summary)."> 
n41    </h2>n39    </p>
42    <h2 id="A_typical_example_of_a_non-inherited_property_is_the_40    <p>
>.7B.7B_Cssxref(.22border.22)_.7D.7D_property._Given_the_style_rul 
>es.3A"> 
n44    </h2>n42    </p>
45    <h2 class="brush: css" id=".C2.A0p_.7B_border.3A_medium_solid43    <pre class="brush: css">
>_.7D"> 
46      &nbsp;p { border: medium solid }44 p { border: medium solid }
45</pre>
47    </h2>46    <p>
48    <h2 id="and_the_markup">
n50    </h2>n48    </p>
51    <h2 class="brush: html" id=".C2.A0_&lt;p&gt;This_paragraph_ha49    <pre class="brush: html">
>s_&lt;em&gt;emphasized_text&lt;.2Fem&gt;_in_it.&lt;.2Fp&gt;"> 
52      &nbsp; &lt;p&gt;This paragraph has &lt;em&gt;emphasized tex50  &lt;p&gt;This paragraph has &lt;em&gt;emphasized text&lt;/em&gt
>t&lt;/em&gt; in it.&lt;/p&gt;>; in it.&lt;/p&gt;
51</pre>
53    </h2>52    <p>
54    <h2 id="the_words_.22emphasized_text.22_will_not_have_a_borde
>r_(since_the_initial_value_of_.7B.7B_Cssxref(.22border-style.22)_ 
>.7D.7D_is_none)."> 
n56    </h2>n54    </p>
n60    <h2 id="The_.7B.7B_Cssxref(.22inherit.22)_.7D.7D_keyword_allon58    <p>
>ws_authors_to_explicitly_specify_inheritance._It_works_on_both_in 
>herited_and_non-inherited_properties."> 
n62    </h2>n60    </p>
n66    <h2 id=".7B.7B_CSS_key_concepts()_.7D.7D.C2.A0">n
67      {{ CSS_key_concepts() }}<span style="background-color:#ff00
>00;"><span style="color:#00ffff;"><span id="cke_bm_391C" style="d 
>isplay: none;">&nbsp;</span></span></span> 
68    </h2>
n71        <h2 id="CSS_Reference">n
72          <a dir="ltr" href="/en-US/docs/CSS/CSS_Reference" title66        <a href="/en-US/docs/CSS/CSS_Reference" title="CSS Refere
>="CSS Reference">CSS Reference</a>>nce">CSS Reference</a>
73        </h2>
tt68      <li>{{ CSS_key_concepts() }}
75      <li>69      </li>
76        <dl>70      <li>{{ Cssxref("inherit") }}
77          <dd>
78            <dl>
79              <dt class="brush: js">
80                {{ Cssxref("inherit") }}<span id="cke_bm_536C" st
>yle="display: none;">&nbsp;</span> 
81              </dt>
82            </dl>
83          </dd>
84        </dl>

Back to History