HTML style attribute in Tag | Example code

HTML style attribute is used to style an specific elements (tag) in webpage. It will override the other CSS (External CSS).

Inline CSS method use style attribute inside the HTML start tag.

Note: The style attribute can be used on any HTML element ( < p >, < div >, < a >, etc).

Example of HTML style attribute

The style attribute includes a series of CSS property and value pairs. Each ‘ property : value ‘ pair is separated by a semicolon ( ; ).

Code line

Complete Example code

Output:

Example of HTML style attribute

Do comment if you have any doubts and suggestion on this HTML topic.

Note: The All HTML Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.