Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you style a noscript element?

Tags:

html

css

noscript

Is it possible to use the noscript element in CSS selectors?

noscript p {
    font-weight: bold;
}
like image 934
nickf Avatar asked Mar 24 '09 03:03

nickf


1 Answers

Yes! You can definitely do that.

In fact, many (all?) browsers support targeting any arbitrary tag using CSS. "Official" tags in the HTML spec only define what a browser should do with them. But CSS is a language that targets any flavor of XML, so you can say foo {font-weight:bold;} and in most browsers, <foo> hello world </foo> will come out bold.

As Darko Z clarifies, IE6/7 do not add arbitrary (non-standard) elements to the DOM automatically from the source; they have to be programmatically added.

like image 163
Rex M Avatar answered Sep 22 '22 13:09

Rex M