HTML style element

HTML style tag styles the content using CSS properties. CSS(Cascading Stylesheet Sheet) gives style to the sidebar, navbar and content.

<style type="text/css"> 	
	border-left:2px solid green;

i am a div element i am designed by the css given in the style tag. my height is color is light green and my border is green.

Tag omission

Both opening and closing tags are necessary for the style element.

Global Attributes

All the global attributes are applicable on the style element.

Tag Attributes

Attributes that are applicable to <style> tag

This attribute contains the address or URL of the other pages.

<style type="text/css"> Here the properties of CSS are present </style>

This attribute tells about which media type this style sheet applies to. For instance, screen, print, projection etc.

<style media="print"> Here CSS properties are applicable for print media </style>

Was this article helpful?