Situation: Say I type some website's URL into my search bar. The server sends some HTML and CSS files to my computer.
Question: How does my web browser decide which file among the received files is the entry point (or otherwise "starting point") from which to start evaluating/rendering?
What I've tried: Googling various phrases and doing a cursory search on SO. But my search terms might've been suboptimal, and this question might seem stupid, because I don't know what I don't know.
The browser initially requests exactly one thing from the server: the path requested. For example, for this page here, the request is to:
https://stackoverflow.com/questions/65366695/how-does-a-web-browser-decide-on-an-entry-point-among-the-files-it-receives-from
That path can be considered to be the entry point. Then, inside the response:
view-source:https://stackoverflow.com/questions/65366695/how-does-a-web-browser-decide-on-an-entry-point-among-the-files-it-receives-from
, it finds paths to other resources to download. For example, this page has:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.sstatic.net/Js/stub.en.js?v=95d1ce093683"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Shared/stacks.css?v=50b8afc7d7a9">
in the source code of the HTML response. These resources are then downloaded by the browser.
Other parts in the HTML, CSS, and JavaScript may initiate downloads as well, but it'll all ultimately stem from the initial HTML file requested (which may have been done by the user typing in an address, or by clicking on a link).