tags:

views:

29

answers:

3

Hi, is this allowed?

<style id="my_id_0" type="text/css"> ...

Thanks in advance! Peter

A: 

Not allowed according to W3C. Just wrap your <style> tag with <span></span>

UrK
It is invalid for the `style` tag to appear anywhere except in `head`.
casablanca
W3 Schools is not a good source.
Gumbo
W3Schools is **not** the W3C
David Dorward
+3  A: 

According to the XHTML 1.0 Strict DTD it is allowed but how it is actually supported by browsers (especially when the style-tag is used within the head) is another question.

Horst Gutmann
+1  A: 

It depends which markup language you are using.

  • It is not allowed in HTML 4.01.
  • It is allowed in XHTML 1.0 (this looks like one of many changes that the working group decided to implement without a mention in the differences from HTML 4.01 section)
  • It is allowed in the HTML 5 draft
David Dorward