Inline style HTML | Apply CSS rules directly into the start tag

Using Inline style in HTML webpage you can apply the unique style rules to an element ( <p>, <div>, <a>, etc). The style attribute includes a series of CSS property and value pairs. Each property: value pair is separated by a semicolon (;).

Note: The style attribute will override any style set globally (Internal or External CSS)



Example of Inline style HTML

Here’s a basic example of HTML page using inline styles:

In code the p tag with the inline style attribute to change font color and size.


Example of Inline style HTML

The inline style HTML attributes:-

One or more CSS properties and values separated by semicolons (e.g. style=”color:red; text-align:left”)

Style attributes are: property and value.

 inline style HTML attributes

Do comment if you have any questions and suggestions on this article.

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.