Horje
HTML style Attribute

Definition and Usage

The style attribute specifies an inline style for an element.

The style attribute will override any style set globally, e.g. styles specified in the <style> tag or in an external style sheet.

The style attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).

Browser Support

Syntax

<element style="style_definitions">

Attribute Values

Value Description
style_definitions One or more CSS properties and values separated by semicolons (e.g. style="color:blue;text-align:center")

How to Use of the style attribute in an HTML document

Here is a example of HTML Style.
index.html
Example: HTML
<h1 style="color:blue;text-align:center;">This is a header</h1>
<p style="color:green;">This is a paragraph.</p>

Output should be:

How to Use of the style attribute in an HTML document




html style attribute

Related Articles
HTML accesskey Attribute HTML Global Attributes
HTML class Attribute HTML Global Attributes
HTML contenteditable Attribute HTML Global Attributes
HTML data-* Attributes HTML Global Attributes
HTML dir Attribute HTML Global Attributes
HTML draggable Attribute HTML Global Attributes
HTML enterkeyhint Attribute HTML Global Attributes
HTML hidden Attribute HTML Global Attributes
HTML id Attribute HTML Global Attributes
HTML inert Attribute HTML Global Attributes
HTML inputmode Attribute HTML Global Attributes
HTML lang Attribute HTML Global Attributes
HTML popover Attribute HTML Global Attributes
HTML spellcheck Attribute HTML Global Attributes
HTML style Attribute HTML Global Attributes
HTML tabindex Attribute HTML Global Attributes
HTML title Attribute HTML Global Attributes
HTML translate Attribute HTML Global Attributes
HTML Global Attributes HTML Global Attributes

Single Articles
How to Use of the style attribute in an HTML documentHTML Global Attributes

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Global Attributes
Uploaded by:
Admin


Reffered: https://www.w3schools.com/tags/att_global_style.asp