Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Html Tags > Table in a <div...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 378 of 439
Post > Topic >>

Table in a <div> element style question

by "Joe Hesse" <joe_hesse@[EMAIL PROTECTED] > Dec 2, 2005 at 10:37 AM

Hi,

I have two complete html files below.
The first one has an inline style in the <body> element.
The second one has an inline style in the <div> element.
Otherwise, the files are the same.

When the first file is viewed with a browser both the paragraph and
table are red.  When the second file is viewed with a browser only the
paragaph is red.  I expected that both the paragraph and table would
display as red in the second file since the <div> element encloses both
of them.

I have used Firefox, Mozilla, and IE, all with the same results.

Please help.

Thank you,
Joe Hesse

----- demo1.htm -----
<html><head></head>

<body style="color:red">

<div>

<p>Some Text</p>

<table border="2">
  <tr><td>Dog</td><td>Carrot</td></tr>
  <tr><td>Cat</td><td>Spinach</td></tr>
</table>

</div>

</body></html>

----- demo2.htm -----
<html><head></head>

<body>

<div style="color:red">

<p>Some Text</p>

<table border="2">
  <tr><td>Dog</td><td>Carrot</td></tr>
  <tr><td>Cat</td><td>Spinach</td></tr>
</table>

</div>

</body></html>




 3 Posts in Topic:
Table in a
"Joe Hesse" <  2005-12-02 10:37:38 
Re: Table in a
David Dorward <dorward  2005-12-02 19:09:18 
Re: Table in a
Ed <ex@[EMAIL PROTECTE  2005-12-03 01:11:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 5:21:59 CDT 2008.