Insert (add, append) CSS to head element via GopherJS.
import "github.com/gopherjs/gopherjs/js"
func appendCSSToHeadElement() {
css := `.tooltip {
position: absolute;
left: -9999px;
background-color: #CCFFFF;
border-radius: 10px;
font-family: Tahoma, Arial, serif;
word-wrap: break-word;
}`
s := js.Global.Get("document").Call("createElement", "style")
s.Set("innerHTML", css)
// insert style of tooltip at the end of head element
js.Global.Get("document").Call("getElementsByTagName", "head").Call("item", 0).Call("appendChild", s)
}
References: