Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/html/global_attributes/style/index.md
6555 views
---
title: style slug: Web/HTML/Global_attributes/style page-type: html-attribute browser-compat: html.global_attributes.style
---

{{HTMLSidebar("Global_attributes")}}

The style global attribute contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files. This attribute and the {{HTMLElement("style")}} element have mainly the purpose of allowing for quick styling, for example for testing purposes.

{{EmbedInteractiveExample("pages/tabbed/attribute-style.html","tabbed-shorter")}}

Note: This attribute must not be used to convey semantic information. Even if all styling is removed, a page should remain semantically correct. Typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

All global attributes.