goh4警告:这个包在不断变化。您还不应该在生产中使用它。API将/可能会中断。键入save html和css generation for golang with functions。例子:


package main



import (

  \"fmt\"

  \"github.com/metakeule/goh4\"

)



func main() {

  tfont := NewCss(

    ttClass(\"default-font\"),

    ttStyle(\"font-size\", \"20\", \"font-weight\", \"normal\")

  )

  tcss := NewCss(

    ttClass(\"yellow-button\"),

    ttTags(\"a\", \"button\"),

    ttStyle(\"background-color\", \"yellow\")

  )

}