airesofwar Posted November 11, 2010 Share Posted November 11, 2010 I keep looking for how to use inherit positioning correctly but I am having troubles with this. inherit: Specifies that the value of the position property should be inherited from the parent element???Not really understanding that line. Could someone give me a example of how it should be written out? Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 an element contained within another element, i.e. <div id="parent"> <p id="child>Lorem Ipsom</p></div> With inherit positioning applied to the <p> tag (child), if the the <div> (parent) had a positioning applied to it, the child would also have the same value for the positioning attribute of the parent. Link to comment Share on other sites More sharing options...
dsonesuk Posted November 11, 2010 Share Posted November 11, 2010 But! because IE does not support position: inherit; it would be waste of time using it, if you want your site to be cross browser compatible. Link to comment Share on other sites More sharing options...
airesofwar Posted November 11, 2010 Author Share Posted November 11, 2010 So when using it in the CSS code I would just state something like this. .headerwrap {position: inherit; } The in the <body> I would refer to it with something like this. <div class="mainwrap"> <div class="headerwrap"></div></div> Would that place the two over top of each other? Link to comment Share on other sites More sharing options...
thescientist Posted November 11, 2010 Share Posted November 11, 2010 i guess. it all depends on what's going on with mainwrap's positioning. Link to comment Share on other sites More sharing options...
ShadowMage Posted November 11, 2010 Share Posted November 11, 2010 If mainwrap had position: absolute; on it, then headerwrap would also be absolutely positioned. The inheritance does not affect the position of an element only the positioning type (ie, relative, static, absolute) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.