Giter Site home page Giter Site logo

Comments (4)

joakin avatar joakin commented on August 22, 2024

Oh wow, I don't know why this is happening!

It is good practice to have the doctype directive in html files, see https://developer.mozilla.org/en-US/docs/Glossary/Doctype

Its sole purpose is to prevent a browser from switching into so-called "quirks mode" when rendering a document; that is, the "" doctype ensures that the browser makes a best-effort attempt at following the relevant specifications, rather than using a different rendering mode that is incompatible with some specifications.

Unfortunate this is happening. I see it happen in chrome firefox and safari...

Going to investigate a bit to see what is up. As a workaround, you can set the width and height on the canvas with Html.Attributes.style.


BTW in this ellie https://ellie-app.com/mSkWgBR8Q5Na1, I tried removing the doctype and it still shows the red bar at the bottom 😖

from elm-canvas.

joakin avatar joakin commented on August 22, 2024

https://stackoverflow.com/questions/7266276/doctype-affects-width-and-height-of-html-body-canvas 💡

from elm-canvas.

joakin avatar joakin commented on August 22, 2024

Exactly right, adding display: block; to the inner canvas fixes this... What a dumb default for a canvas element, display inline... 🤦

This needs fixing in the library then 👍

from elm-canvas.

benjamin-thomas avatar benjamin-thomas commented on August 22, 2024

Exactly right, adding display: block; to the inner canvas fixes this... What a dumb default for a canvas element, display inline... facepalm

This needs fixing in the library then +1

Thanks for finding a solution @joakin. I suspected something a little more tricky, but in the end it's a pretty easy fix then :)

Have a great week

from elm-canvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.