The HTML <style>
element is used to style an HTML document or part of a document without the need for an external stylesheet.
It is usually placed in the <head>
element of an HTML document, and it specifies how HTML elements should render in a browser.
Attributes provide additional properties of an HTML element and are always defined in the opening tag.
The <style>
element contains attributes that define additional characteristics of the element, and it also supports the Global Attributes in HTML.
Note: Click on the link below to read on Global Attributes in HTML.
<style>
elementAttribute | Value | Description |
type | text/css | It species the styling language. |
media | media_query | It specifies the media the styles apply to. |
Single styling applies the <style>
element once in a document while multiple styling applies the <style>
element more than once in a document.
Although the <style>
element provides a document’s CSS style information, the generally preferred method is to export an external stylesheet.