Search code examples
htmlelmmarkup

How do I use span around text in Elm?


How can I write the following markup in Elm?

<p>Here is <span class="red">some text.</span></p>

Solution

  • The exact answer seems to be a bit of both of the first two answers

    someText : Html Msg
    someText =
        p []
            [ text "Here is "
            , span [ class "red" ] [ text "some text." ]
            ]