https://i.sstatic.net/GGYxm.png
The screenshot above shows the initial setup in Firefox's developer tools. There is a <link rel="stylesheet">
in the header, but no styles are applied to the <body>
element in the lower viewport. The second image demonstrates that the web request for this stylesheet is indeed made:
https://i.sstatic.net/oyp5l.png
When I navigate to the Style Editor
tab in Firefox's developer tools and add an extra character (such as a newline between the import
and the body
), Firefox updates the stylesheet and the styles are then applied to my webpage, as shown in the third and fourth images:
https://i.sstatic.net/uaKlh.png https://i.sstatic.net/OmjSZ.png
How can I ensure that my styles are applied correctly during page load?
EDIT: It's worth mentioning that I did not encounter this issue when testing my app using create-react-server
's development server or with python3 -m http.server
as the web server. The problem only arises when using nginx as a server, despite all web servers serving the same static content.