Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

style

The <style> element is used to specify in-document CSS definitions for elements in the document.

Code Example

<style> p { font-style:italic; } #p1 { font-size:20px; } #p2 { font-size:12px; } div { color:red; } </style> <p id="p1">This is some content...</p> <p id="p2">This is some content...</p> <div>Div content...</div> open in code editor

Attributes

globals - the global attributes common to all elements possible values: see global attribute list media - specify the media for which the style will apply to possible values: "media query" type - specify the MIME type for the styling language being used possible values: "valid MIME type" scoped - specify styling be applied only to the style element's parent element possible values: value not required

Official Documentation

http://www.w3.org/TR/html/document-metadata.html#the-style-element

HTML

Elements

aabbraddressareaasidearticleaudiobbasebdobdiblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1 h2 h3 h4 h5 h6headheaderhrhtmliiframeimginputinskbdkeygenlabellegendlilinkmainmapmarkmetameternavnoscriptobjectoloptgroupoptionoutputpparampreprogressqrb rp rt rtc rubyssampscriptsectionselectsmallsourcespanstrongstylesub supsummarytabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarvideowbr