Hiccup div color change

Is there a way to set the background color of a div to hiccups? Here is what I have tried so far, with no result:

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

In html, I see <div background-color="#663366">which, in my opinion, is not the right format for the color.

Is there a way to do this in a hiccup?

+3
source share
1 answer
[:div {:style "background-color:#003366"} (escape-html rest)]

Gotta do the trick. You might want to put your styles in css files in a different place, although you are doing something quite complicated.

+8
source

Source: https://habr.com/ru/post/1766431/


All Articles