Jump to content

Can I add an inline style to a class that is defined in my style sheet?

Recommended Posts

Hi Guys, Could you please help me out with this one. I have a style sheet that manipulate certain elements on my page. I would however like to know if I could style a portion of a paragraph with the inline style method.


The code on my webpage is as follows:

<p class ="two">Hello World - CSS allows you to modify margin, paddings and borders.</p>


I would like to apply and inline style that only affects the word "CSS" want to change the font and the color but it does not work.


example: <p class="two">Hello Word <style = "color:white; font-bold:,>CSS</style> allows you to modify margins, paddings, and borders.</p>


This does not seems to work. Can someone please help me with the proper code?


Please see attach file to look at the CSS code. I am new to this and would appreciate all the help.





Thanks so much Foxy Mod - span style works perfectly.


Edited by HumbleApprentice
Link to post
Share on other sites

Use a <span> element

<p class="two">Hello Word <span style="color:white; font-weight: bold;">CSS</span> allows you to modify margins, paddings, and borders.</p>
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...