Forum Moderators: open
When using multiple <div> statements, and you close one, what is the order it closes?
here is an example:
css reference
body{text:12px; color: black;}
div.1{color: red;}
div.2{color: blue;}
div.3{text:10px;}
<body>
<div id=1><div id=2><div id=3> ABC </div> XYZ </div> 123</div>
In this statement is ABC red or blue and size 10? Is XYZ black and size 12 or red size 10?
XYZ is still blue because it's still within div#2. But it's not within div#3 which is closed - so it is size 12, not 10.
By the way, I assumed you meant div#1 and not div.1
Also note, it is not a good idea to begin a class or ID name with a numeral. Older versions of IE will (incorrectly) forgive it but not other browsers.
index.php
<?php require('header.php');/?>
My Content
<?php require('footer.php');/?>
header.php
<head>
<style>
body{text:12px; color: black;}
div#1{color: red;}
div#2{color: blue;}
div#3{text:10px;}
</style>
</head>
<div id="2"><img src="logo">
<br><br>
<a href="contact.php">contact us</a>
<a href="products.php">products</a>
<br><br>
I am writing this as as example
<br><br>
contact.php
<div id="1">
My name is Aeramas
(555)555-1234
Dallas Texas
</div>
note: <div id=2> in the header is still open. Does that make the content on index.php in the body black size 12? or Blue size 12?
But the general answer is still, if the div is open then its rules are in effect - however some other specificity factor may also be in play in any particular situation.