Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    13
    Thanks
    0
    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.

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

    Is using span my best option?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    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
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 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
    •