Hello, I am brand new to the world of HTML and CSS. I have a question about how the HTML code flow works, specifically with internal CSS. From my understanding, the code starts at the top and moves down to the bottom. Take this example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta>.......
<title>Document</title>
<style>
.container {background-color: tomato; padding: 20px;}
.text {color: green;}
</style>
</head>
<body>
<div class="container">
<p class="text">Hello World!!</p>
</div>
</body>
</html>
My understanding is that the CSS styles are stored in a box first, then HTML elements are created. Finally, the box containing the CSS rules looks for the class names and tag names declared in the CSS rules and starts matching and applying styles to the correct HTML elements that are related (and resolves more complex issues like specificity). In a nutshell, is this correct? Please forgive me if this sounds naive, as I am new to all of this.