(Reading time: 1 minute)

CSS - How to apply style changes only to specific text inside a <p> tag?

Linux

When you want to apply specific CSS inline style to some text inside a HTML <p> </p> tag, you can use <span> tag.

 
 
 
<p>This is a <span style="color: navy;">sample text </span>with css applied to span. </p>
 
 
 

 

The above code will look like the following text in the browser:.

This is a sample text with css applied to span. 

 

Oxygen
Author: Oxygen
Other articles by this author

Chillzee Tag Cloud

Let's Socialize

About Chillzee

Chillzee.com is an entrepreneurship portal.

The site provides informative topics on Organizational and Strategic needs.