Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] :first-letter of only one paragraph

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28358
    emma
    Participant

    Hello everyone,

    I am trying to make one of those snazzy drop caps for my sidebar column, but I find it tricky to get it to look the way I want.

    p:first-letter kind of does the trick but instead of targeting all the first letters of paragraphs, I would like only the very first one to be larger. This is what my html looks like:

    Code:

    My column

    Lorem ipsum…

    Lorem ipsum…

    Is there a way to target the first letter of my first text paragraph?
    I know the code is pretty stupid with the p wrapping the image, but it’s WordPress generated and the person who is going to use is doesn’t know html so I would like to find a way without having to edit the code every time the column is updated.

    Any ideas?

    Emma

    #72267
    Chris Coyier
    Keymaster
    Code:
    .column p:first-child:first-letter
    #72268
    Chris Coyier
    Keymaster

    or since the second paragraph looks like the first "text" paragraph:

    Code:
    .column p:nth-child(2):first-letter
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.