Can anyone remember what the code is for diff colur font for....

Discussion in 'CSS' started by Eskarina, Oct 29, 2006.

  1. #1
    Hi :)

    I've just embarked on making my first website out of pure css (I think:p) and remember seeing some snippet of css somewhere that changed the first letter in every sentence to a different style without having to apply special divs manually.

    I think it was really effective in stoppinh myself from skimming over whole paragraphs when the info wasn't relevant to me - instead I just skimmed the irrelevant sentences.

    I have googled for it, but obviously not using the right search terms! Does anyone here remember offhand what the snippet is? It would be great, as I think it might look nice and be quite useful on my new site.

    :D
     
    Eskarina, Oct 29, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    You're looking for the pseudo elements :first-letter and :first-line.
    
    p:first-letter {
        color: red;
        }
    ======
    <p>Now is the time</p>
    ======
    ======
    p:first-line {
        font-weight: bold;
        }
    ======
    <p>Now is the time and enough to wrap to another line &#8230;</p>
    Code (markup):
    cheers,

    gary
     
    kk5st, Oct 29, 2006 IP
  3. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3

    That looks lovely! - thankyou so much :)

    WOW .. all of a sudden I'm actually having a bit of fun with css :p

    Mind you I have only slept for about 6 hours since Fri night, so I could just be imagining it! :eek:
     
    Eskarina, Oct 29, 2006 IP