General questions

<!DOCTYPE html> and Error

 I'm reading this document:

https://myscript.github.io/MyScriptJS/docs/


If I copy and paste the code written in 6, it works. However, if I append <!DOCTYPE html> in the beginning of the code, it does not work. Why?

1 Comment

Dear Takeo Kobayashi San,


thank you for contacting us.


Currently, when using a doctype, you should explicitely set a unit when setting width, height...: https://stackoverflow.com/questions/11384336/javascripts-not-working-when-doctype-html-inserted-in-correct-format


In the current case, replace:

<style>
  #editor {
   width: 100%;
   height: 100%;
}
</style>

By:

<style>
#editor {
width: 100vw;
height: calc(100vh - 152px);
}
</style>


Best regards,


Olivier


1 person likes this
Login or Signup to post a comment