I've encountered an issue where I'm attempting to directly insert a style rule into the head of a document.
Although it successfully inserts the style element, the code itself does not get inserted. Strangely, there are no errors being thrown.
var thumbStyles = document.createElement("style");
document.head.appendChild(thumbStyles);
thumbStyles.sheet.insertRule(
"figure#styleThumbs { \
position: absolute; \
left: 0px; \
bottom: 0px; \
} \
")
thumbStyles.sheet.insertRule(
"figure#styleThumbs img { \
outline: 1px solid black; \
cursor: pointer; \
opacity: 0.75; \
} \
")
thumbStyles.sheet.insertRule(
"figure#styleThumbs img:hover { \
outline: 1px solid red; \
opacity: 1.0; \
} \
");
Check out this image of HTML Head showing style but no style code
I attempted to ask about this on FCC but have yet to receive any answers