A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: css text can it be done

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    263

    css text can it be done

    Hi. Is there a css tag I can use that would make a certain character a certain color on my page.Even in tables.

    For example say I wanted the letter "A" to be red everywhere on the page.
    Can css do this.

    Thanks

  2. #2
    Retired Mod aversion's Avatar
    Join Date
    Jun 2000
    Location
    insomnia
    Posts
    7,917
    No, you would have to wrap every instance of 'A' with span tags and apply a CSS color property to that. CSS can only be applied to elements, to identify characters on the page you need a containing element.

    CSS 3 might be able to help you with advanced selectors but it wouldn't work in the majority of browsers. You could also do this with some javascript.

    CSS would be something like:
    Code:
    p span {
       color: red;
    }
    
    <p>This is <span>a</span>n ex<span>a</span>mple of <span>a</span>dding sp<span>a</span>n t<span>a</span>gs to the p<span>a</span>ge to m<span>a</span>ke 'A's red</p>
    If you used spans inside a paragraph in other instances then you could use a class.

    I'm not sure what you mean by 'CSS tags' but just to be clear there are no CSS tags, CSS is applied to HTML tags.

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    263
    Thanks aversion.That seems to be o.k. To tell you the truth I don't know what I meant by "CSS tags" either. Probably has something to do with my very limited knowledge of CSS Lol.

    Thanks

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center