Back to CSS Notes
Topic #8

Add Inline Style

Inline styles apply directly to one element through its style attribute. Powerful in emergencies, but they break the separation of concerns.


Inline CSS

An inline style may be used to apply a unique style for a single element.

To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.

Example

  <!DOCTYPE html>
<html>
<body>

<h1 style="color:blue;text-align:center;">This
  is a heading</h1>
<p style="color:red;">This is a paragraph.</p>

  </body>
</html>

Tip: An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly.

Want to go beyond the notes?

Join Coding Now Tech Institute's CSS course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Add Inline Style – FAQs

Quick answers about learning Add Inline Style in CSS.

This free note from Coding Now Tech Institute explains Add Inline Style in CSS — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every CSS topic on Coding Now Tech Institute, including Add Inline Style, is 100% free with no signup required.
With focused practice, most students grasp Add Inline Style in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now