Fandom

HTML & CSS Wiki

Style

648pages on
this wiki
Add New Page
Comments0 Share

The HTML <style></style> element is used to define style information for an HTML document. In this element you specify how HTML elements should render in a browser. It is typically used for internal CSS within a document. If the scoped attribute is not defined, the <style> element must be placed in the <head> section. To link to an external style sheet, use the <link /> element.


AttributesEdit

Attribute Value Description
type text/css Defines the content-type. Allows the use of internal CSS within the <head> element.
media screen
tty
tv
projection
handheld
print
braille
aural
all
The destination medium for the style information.
scoped scoped If present, the styles should only apply to the <style> element's parent element and its child elements.


HTML example:

<html>
    <head>
        <title>Da title</title>
        <style type="text/css">
           h1 {
               color:red;
           }

           h2 {
               color:blue;
           }
         </style>
     </head>
     <body>
        Body content.
     </body>
</html>

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.