<style> element is used to define style information for a document, or part of a document.
It contains CSS, which is applied to the contents of the document containing the
<p>This is my first CSS example</p>
<style> element can be included inside the <head> or <body> of the document, and the styles will still be applied, however it is recommended that you include your styles in the <head> for organizational purposes — it is a lot better to separate your content from your presentation as much as possible. Even better, put your styles in external stylesheets and apply them using <link> elements.
You can learn more about CSS in our CSS tutorial.
<style> element is fully supported by all browsers:
The following table shows the attributes that are specific to the
|media||media_query||Specifies the device the document will be displayed on|
|type||text/css||Specifies the media type of the <style> element. This attribute is required in HTML 4, but optional in HTML5|
<style> tag supports the global attributes described in HTML Global Attributes Reference
<style> tag supports the event attributes described in HTML Events Reference
Last updated: Monday 01 Oct, 2018