skip to Main Content

For example, I want to add color=red to the phone and email, enclosed by . It seems I can’t use an embedded to add color. If I don’t use CSS, how can I directly add color to it?

<p>For appointment, please call Martin at <strong>xxx-xxx-xxxx</strong> or email at <strong>[email protected].</strong></p>

3

Answers


  1. You can use inline-styling for this purpose

    <p>For appointment, please call Martin at <strong style="color:red">xxx-xxx-xxxx</strong> or email at <strong style="color:red">[email protected].</strong></p>

    If you want you can add additional styling properties in style attribute of HTML Element by separating properties with ;

    Login or Signup to reply.
  2. If you don’t "want" to use css, "font" seems to have a color property…

    <p>For appointment, please call Martin at <strong><font color="red">xxx-xxx-xxxx</font></strong> or email at <strong><font color="blue">[email protected]</font></strong>.</p>
    

    Tell us why you don’t want to use css?

    Login or Signup to reply.
  3. You can use a <style> element to use CSS without referencing another CSS file.

    <style>
      .redtext {
        color: red;
      }
    </style>
    <p>For appointment, please call Martin at <strong class="redtext">xxx-xxx-xxxx</strong> or email at <strong class="redtext">[email protected].</strong></p>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search