Arteqo Consulting

The European Web Agency

Design, brand and digital development


×

Arteqo Consulting Services

Contact Arteqo

×
I have read and accept the terms and conditions

style tag

The style tag, which, when implemented in the code, is written like this - <style>, is an HTML tag that belongs to style and semantic tags. Styles and Semantics HTML tags are used to separate and group content into thematical blocks. The blocks are major groups of content that define the composition and layout of a document.

<style> is used to define style information for an HTML document. Inside the <style> element you specify how HTML elements should render in a browser. Each HTML document can contain multiple <style> tags. This tag is supported in the current version of HTML, which is HTML5.

Browser support

Here you can see whether <style> is supported by a certain browser, and, if yes, starting from which version it is supported.

Browser support for <style>
ChromeFirefoxEdgeOperaSafari
Is supportedIs supportedIs supportedIs supportedIs supported

Attributes and values

An attribute is a piece of additional information about a tag. While tags denote the type of objects they mark or create, attributes set the parameters of these objects. These parameters can include anything from the types of possible interactions to its visual style to its actual contents.

Values indicate how a certain attribute is actually implemented, if there is a number of ways it can happen.

What attributes are actually allowed in a certain tag depends on the tag itself. Much like possible attributes depend on a tag, possible values depend on an attribute.

The <style> tag supports the following attributes (with their respective values):

AttributeValueDescription
mediamedia_querySpecifies what media/device the media resource is optimized for
scopedscopedSpecifies that the styles only apply to this element’s parent element and that element’s child elements
typetext/cssSpecifies the media type of the

Global Attributes

Global attributes are HTML tag attributes that can be used by any tag, hence the name "global". They are in contrast to unique attributes that are tag-specific.

<style> supports global attributes.

Event Attributes

Event attributes are HTML tag attributes that allow triggering actions upon specific conditions, hence the name "event". Other types of attributes, namely global and unique attributes, can also trigger actions, but the difference is that even attributes allow calling scripts, such as JavaScript functions, while most other attributes only support a certain type of action.

<style> supports event attributes.