This <style> element allows a style sheet to be specified for the page. It should appear within the <head> section of a document.
<style> |
Yes | Yes | Yes | Yes | Yes |
None.
Attribute | Value | Description |
---|---|---|
media | media_query | Indicate media/device type for this style |
scoped | scoped | Set that the styles only apply to this element's parent element and child elements |
type | text/css | Set the media type of the <style> tag |
The <style> tag supports the Global Attributes in HTML.
The <style> tag supports the Event Attributes in HTML.
style { display: none; }
A demo showing how to use <style> tag.
<html>
<head>
<style>
body {<!--from w ww .j a v a 2s .c o m-->
background-color: black;
color: white;
}
</style>
</head>
<body>The body cotains a black background and white letters.
</body>
</html>