Style : from v0.18 to v0.19

What is the equivalent of
div [style [("margin-top", "10px"), ("margin-left", "2px")] ] [text "hello world"]
in elm 0.19 ?

Since style now accepts only one setting, how do I stack several ?

Have a look at the documentation:

https://package.elm-lang.org/packages/elm/html/latest/Html-Attributes#style

    div
        [ style "margin-top" "10px"
        , style "margin-left" "2px"
        ]
        [ text "hello world" 
        ]
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.