âInheritâ not working for me Chapter 7, Page 137, The Inherit keyword. Using IE6.0. XP Pro SP2
Intellisense does show the inherit keyword as an option. However at run time no inheritance has occurred.
Try 1 Style. Does not work. Border for childdiv not drawn.
div#parentdiv { border: thin solid black;}
div#childdiv { border: inherit;}
Try 2 Style. Also does not work. Border for childdiv not drawn.
div#parentdiv { border-style:solid; border-width:1px; border-color:Black;}
div#childdiv { border-style: inherit; border-width: inherit ; border-color: inherit;}
Try 3 Style. Also does not work if I put a <style> block in the heading, rather than linking.
Try 4 Style. Does not work if I remove the runat=âServerâ from the <form> block.
Try 5 Style. Does not work if I remove the <form> block altogether.
Only way I can get the inner div border drawn is to NOT inherit:
div#parentdiv { border: thin solid black;}
div#childdiv { border: thin solid black;}
<%@ Page Language="
VB" AutoEventWireup="false" CodeFile="Default.aspx.
vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link rel="Stylesheet" href="StyleSheet.css" type="text/css" />
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div id="parentdiv" >
This div has a border around it.
<div id="childdiv">
This div also has a border around it.
</div>
</div>
</form>
</body>
</html>
Help anyone.
VV