search

Home  >  Q&A  >  body text

javascript - Why does the same sentence of code have different results in the console and in the js file?

With the same code, why are the output results different? I used rem's adaptive layout. I wonder if this has something to do with it? How can it be solved?

This is the css code, 1rem is this number: fontsize=screenWidth/320*100;

天蓬老师天蓬老师2730 days ago686

reply all(1)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-06-12 09:31:30

    The execution time of this line of code in the js file is after the document is loaded
    And the time when you execute the code in the console is after the js processing is completed. During this period, the content has been filled in this element, right?

    reply
    0
  • Cancelreply