I have an Html.img
in Elm and I would like to add src
and a class
to it. How do I do that? Thanks!
import Html exposing (img, div)
import Html.Attributes exposing (class, src)
view : Model -> Html Msg
view model =
div []
[ img [ class "my-img", src "https://loremflickr.com/320/240" ] []
]
View a live example here!
Or read more about Html.Attributes.