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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    controlling letter colors in text via css

    Okay, maybe I'm dense but here's what I have so far and what I'm trying to do:

    Code:
    h1 {
    	font-size: 22pt;
    	color: #000098;
    	font-weight: 200%;
    	margin: 0px 0px 15px 5px;
    	}
    What I want to do is modify this so that the first letter of every word within the h1 element is red (#980000)?

    I thought some variant of first-letter or something would work but it only applies to the first letter of the first word in the h1 element, I need to apply the red coloring to every word's first letter and really don't want to use font tags within the HTML.

    Any suggestions are appreciated, thanks,
    Scott

  • #2
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The only way I can see this working in all the bad browsers would be to nest a <span> inside your <h1> w/ the first letter of the word in the span.
    Horrible way of going about it, but effective.
    Code:
    h1 {
    	font-size: 22pt;
    	color: #000098;
    	font-weight: 200%;
    	margin: 0px 0px 15px 5px;
    	}
    h1 span{
                    color:#980000;
    }

    I take no responsibility for the above nonsense.


    Left Justified


  •  

    Posting Permissions

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