html - Can we choose which parent to inherit from, in css? -
is possible take parent element inherit from? example, have normal html code <body>
tags , that. within <body>
have <header>
, <div id="section">
, can forcefulness #section
inherit height <header>
?
i'm confused @ asking believe reply no.
each tag in html has 1 parent, since parent object straight 'above' tag in hierarchy.
<section> <div id="navigation"></div> <div id="section"> <div id="a"> <div id="b"></div> </div> </div> </section>
in example, #b
's parent #a
. #a
's parent #section
.
to parent of parent, best accomplished in javascript
or jquery
.
edit: considering inheritance in css
css inheritance done through parent level straight above tag, described above. however, multiple inheritance created.
#section
specify font , inherited #a
. in turn, inherited #b
property not overwritten.
html css inheritance
No comments:
Post a Comment