How do I insert a different color text in the middle of a sentence?

I have the following sentence:

"ABC is rated the top program in the nation"

I would like the letters, "top program" to be in red while the rest of the sentence is in black. What is the easiest way to do it in HTML5? I thought of using the <font> tag, but I heard that it is no longer supported in HTML5.
geeta_m9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dsackerContract ERP Admin/ConsultantCommented:
You would write it as follows:
ABC is rated the <span style="color:red;">top program</span> in the nation

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
geeta_m9Author Commented:
That works great! Thank you.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
While the answer is technically correct, the more acceptable way is not using css inline.  The reason for using an external style sheet or <style> tags is if you are doing anything with jquery/javascript it can be problematic.    

Watch what happens when you have both inline and external css  http://jsbin.com/qimahoviri/1/edit?html,output.  The inline has precedence over the external.  When you use jquery for any type of manipulation, it adds inline styles.  I hope it makes sense.  The bottom sample is a better answer for this question.
<!DOCTYPE html>
<html>
<head>
  <style>
  .red{color:red;}
  </style>
  <meta charset="utf-8">
  <title>Q_28651603</title>
</head>
<body>
ABC is rated the <span class="red" style="color:blue;">top program</span> in the nation
</body>
</html>

Open in new window





http://jsbin.com/fofuvaqaju/1/edit
<!DOCTYPE html>
<html>
<head>
  <style>
  .red{color:red;}
  </style>
  <meta charset="utf-8">
  <title>Q_28651603</title>
</head>
<body>
ABC is rated the <span class="red">top program</span> in the nation
</body>
</html>

Open in new window

0
geeta_m9Author Commented:
Thank you for the clarification.
0
dsackerContract ERP Admin/ConsultantCommented:
Hi geeta_m9,

I stayed with your constraint of "the easiest way", but if you are studying CSS, you will enjoy using them. You can even keep style sheets in a separate file and bring them into your HTML page. If you want to know more, perhaps in time you might open up a new question or two. Many are glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.