CSS Almanac

Home » CSS Almanac » Selectors » P » Pseudo Class Selector

Pseudo Class Selector

Browser Support

Chrome Safari Firefox Opera IE Android iOS
TBD TBD TBD TBD TBD TBD TBD

Subscribe to The Thread

  1. paul Laman

    Chris,

    I’m having an awful time with pseudo selectors. I would like to setup my site and prepare it for wordpress (custom Theme) as I’m cutting up the PSD to prepare it. I got most of the stuff fixed but I would like to add the pseudo selector for p:first-letter{}

    however, they is a possibility of multiple paragraphs posting through wordpress. This means that every paragraph will have the dropcap. I only want the first letter of the first paragraph to be drop capped. Herein lies the problem. The p:first-letter{} works in html markup but I cannot get your solution for p:nth-child():first-letter{} to work.
    Possible conclusions I came up with:
    1. Working locally on a virtual server(similar to WAMP or MAMP)
    2. I am doing something wrong with the selector.

    Could you shed some light on this?

    Note I get an error when I type the parenthesis for nth-child. This might give you an indication on what I might be doing wrong. Please advise.

    Also, I want to avoid using span tags for markup as it will make things icky with wordpress and possible design changes later on.

    Thanks for your expedited response in advance.

    P.

  2. paul Laman

    Chris,

    I’m having an awful time with pseudo selectors. I would like to setup my site and prepare it for wordpress (custom Theme) as I’m cutting up the PSD to prepare it. I got most of the stuff fixed but I would like to add the pseudo selector for p:first-letter{}

    however, thereis a possibility of multiple paragraphs posting through wordpress. This means that every paragraph will have the dropcap. I only want the first letter of the first paragraph to be drop capped. Herein lies the problem. The p:first-letter{} works in html markup but I cannot get your solution for p:nth-child():first-letter{} to work.
    Possible conclusions I came up with:
    1. Working locally on a virtual server(similar to WAMP or MAMP)
    2. I am doing something wrong with the selector.

    Could you shed some light on this?

    Note I get an error when I type the parenthesis for nth-child. This might give you an indication on what I might be doing wrong. Please advise.

    Also, I want to avoid using span tags for markup as it will make things icky with wordpress and possible design changes later on.

    Thanks for your expedited response in advance.

    P.

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~