Page 1 of 1

div inheritance

Posted: Sat Sep 24, 2005 4:54 am
by s.dot

Code: Select all

<style type="text/css">
body {
	font-family: verdana, tahoma, arial;
	color: #000000;
	font-size: 9pt;
}
body A:link {
	font-size: 7pt;
	font-family: verdana, tahoma, arial;
	color: #000000;
	font-weight: bold;
	text-decoration: none;
}
body A:visited {
	font-size: 7pt;
	font-family: verdana, tahoma, arial;
	color: #000000;
	font-weight: bold;
	text-decoration: none;
}
body A:active {
	font-size: 7pt;
	font-family: verdana, tahoma, arial;
	color: #000000;
	font-weight: bold;
	text-decoration: none;
}
body A:hover {
	font-size: 7pt;
	font-family: verdana, tahoma, arial;
	color: green;
	font-weight: bold;
	text-decoration: none;
}
.box
{
	border: solid 2px #000000;
	background: #FFFFFF;
	padding: 2px;
}
.form {
	border: solid 1px #000000;
	cursor: default;
}
.nav {
	font-family: verdana, tahoma, arial;
	font-size: 9pt;
	color: #000000;
}
</style>
Suppose I had <div class="box">Regular text - <a href="#">Link text</a></div>

The link text will inherit the body's link style, but the regular text will not be the body's text style. Am I doing something wrong?

I would like for a <div class="box"></div> to inherit BOTH the regular text style, and the link text style

Posted: Sat Sep 24, 2005 5:32 am
by feyd
box does not inherit from body

Posted: Sat Sep 24, 2005 6:15 am
by s.dot
then why are the links inside of "box'' the same style as body link? when i have not set the box links

Posted: Sat Sep 24, 2005 7:04 am
by wwwapu
I don't see it. When testing It inherits just fine (IE6 , Ff 1.06 and Opera 8.5). Which browser are you using?

Code: Select all

body { 
   font-family: verdana, tahoma, arial; 
   color: #ff0000; 
   font-size: 20pt; 
}
...
.box 
{ 
   border: solid 2px #000000; 
   background: #FFFFFF; 
   padding: 2px; 
} 
... 
<p>
Regular text- <a href="#">Link</a>
</p>

<div class="box">
Regular text- <a href="#">Link</a>
</div>

Posted: Sat Sep 24, 2005 7:50 am
by s.dot
Heh.. that is weird. =/ thanks for the reply! given second testing it now works.

Posted: Sat Sep 24, 2005 7:57 am
by s.dot
ah, turns out it was because my <div></div> was inside a table cell. i guess table cells inhert the body td {} which wasn't set.. so it used default settings.