Hi, I’m totally new to Elm and I’m enjoying it so far.
I’m trying to draw something with svg and I need to make html and body to fill up the entire window (width: 100%; height: 100%;).
From what I understood by searching the web it seems that Elm discourages external CSS files and instead suggests using inline styles? I’m willing to give it a try, but I can’t figure out how to apply an inline style to the html and body tags in this case, since they are already rendered by the time my code has any effect.
To make body fill up the entire window you’d write the following CSS:
body {
margin: 0;
height: 100vh;
}
By default body has margin so we remove it. Then, we make the height of the body equal to 100% the height of the viewport. Read about viewport-percentage lengths here.
N.B.You don’t need to set the width since it already expands to fill the width of the viewport.
For a concrete example, you can look at how it’s done in this app, here.