Upon analyzing the code provided, it was observed that if there is no content inserted between the tags as shown in <div id="header"></div
, the corresponding style does not get applied.
- Is it mandatory to always have content placed between the tags?
- Are there alternative methods to achieve the desired outcome, especially when there is no content intended for display?
An illustrative example of this issue can be viewed at http://jsfiddle.net/7mZxG/
Code Snippet
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
... (code continues) ...
</script>
</head>
<body>
... (HTML body structure)
</body>
</html>