Mantas Vidutis
Mantas Vidutis

Reputation: 16794

Change a div color in hiccup

Is there a way I can set a div background color in hiccup? Here is what I tried so far, with no result:

[:div {:background-color "#003366"} (escape-html rest)]

In the html, I see <div background-color="#663366"> which I do not believe is the correct format for color.

Is there a way to do this in hiccup?

Upvotes: 3

Views: 494

Answers (1)

Rayne
Rayne

Reputation: 32635

[:div {:style "background-color:#003366"} (escape-html rest)]

Should do the trick. Might want to consider putting your styles into css files elsewhere though, if doing anything reasonably complex.

Upvotes: 8

Related Questions