SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Using CSS To Color Certain Characters

    Sitepoint Members,
    Is there a way to use CSS to color a specific character whereever it appears without doing anything in HTML to prompt the coloring (w/o span)?

    Thanks,

    Chris

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,301
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    No, not without some kind of styling hook like a span. You can do it with JS, though.

  3. #3
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,816
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    I am sorry to say , no. CSS styles elements and individual characters aren't elements; they are one could say a 'property' of an element.

    Besides, it really doesnt go with what CSS does. If all the letter Es are supposed to be red for some reason.. then that reason should be reflected in the markup. Otherwise that what Span is there for, specifically.. to HOOK CSS


    Keep in mind tho , tho you aren't necessarily restricted to using SPAN. There are other presentational elements still around, such and I and B, which you could use to exclusively wrap a charter.

  4. #4
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'll have to modify that wish and do it just for the first quote in a page and use span or others.

    I have a php file that directs all the html files. Is there a way to do it in php?


    Chris

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,301
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Chris77 View Post
    Is there a way to do it in php?
    Depends on what you want to do in PHP. The question is not very specific. But ultimately the styling will be handled by CSS in some fashion, because the PHP is gone by the time the page gets to the browser.


Bookmarks

Posting Permissions

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