Apply .css styles before displaying page

0

I do not have much experience in web programming. In the site I'm creating I had a problem with the graphical formatting of .css not being applied and creating strange effects when displaying the page, and I could not find a solution on the web. I do not know if it is the best way to program, but my solution, where the page is only shown after all applied .css styles, was:

In the 'body' tag create an id and 'hidden' in the class, in the _Layout.cshtml page (generate all other pages), and inside the 'head' tag and the 'jquery' .ready (...): And the 'body' section is only shown after stylized. It also does not seem to affect the wait times when the page is displayed and my .css file is not even 'minified'.

<head>
<script>
        $(document).ready(function () {
            //... outro código 

            // NO FIM DA FUNÇÃO:
            var b = document.getElementById("body_id");
            b.className = "";
        });
</script>
</head>
<body id="body_id" class="hidden">
  <!-- design da página -->
</body>
    
asked by anonymous 24.01.2018 / 01:03

0 answers