Any styling applied via CSS will override any styling applied via HTML even where the HTML styling reference comes last.
If you try to apply HTML styling via JavaScript after the page has loaded then the CSS styling will still win even though the HTML styling is applied after the CSS.
For example a page coded as follows will have a white background (as defined by the CSS) and not a black background (as applied via updating the HTML attribute from JavaScript):
Code:
<head>
<style type="text/css">
body {background-color: #fff;}
</style>
</head>
<body>
...
<script type="text/javascript">
document.body.bgcolor = '#000000';;
</script>
</body>
The HTML attributes can be considered to be at a level below the lowest level of relevance that can be defined in the CSS so a body background-color reference in the CSS takes precedence over a body bgcolor HTML reference regardless of which order they get defined in.
Bookmarks