Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2007
    Thanked 0 Times in 0 Posts

    Best option for adding color to specific words in a list

    I have a list and i would like to add color to a few different words.

    The changed words will all use the same color.

    It needs to be xhtml strict.

    Things you should not do.
    <li>Please do not run with scissors.</li>
    <li>Do not swim after eating.</li>
    <li>Do not try to climb that tree.</li>

    Is using span my best option?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    A span would probably be the best choice. Some will say that using a span is almost like using a font tag.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Splendora, Texas, United States of America
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by us3rd4n View Post
    Is using span my best option?
    Using em or strong elements would probably be the most appropriate thing here.

    Quote Originally Posted by _Aerospace_Eng_ View Post
    Some will say that using a span is almost like using a font tag.
    Personally, I would only say that if you used the style attribute since you’re still not separating structure from presentation. Otherwise, span should be fine as long as there isn’t a more specific element.
    For every complex problem, there is an answer that is clear, simple, and wrong.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts