[resolved] Can't get p:first-child to work - (2011 .singular issue?) (4 posts)

  1. AardvarkGirl
    Posted 3 years ago #

    I want the first paragraph to have a right margin or padding. I had it working in the static version of the site.

    It isn't working in the WP version however... http://ratest12.com/bios/ I think it is due to the body .singular class. I will not ever be using a 'single column/no sidebar' page on this (2011 duplicate theme) site so instead of doing the tedious work around in the functions.php file to remove the .singular class or forcing the site owner to select the 'sidebar' template whever he creates a page, I simply forced the default page template to be 'sidebar friendly'. I then went through the style sheet and removed the .singular references.

    Yes, I have Firbug and the Chrome inspector. This is a fresh, clean WP install, no plugins.

    I'm trying;

    p:first-child {padding-right:10%;}


    .entry-content p:first-child {padding-right:10%;}

    I'm trying margin, I'm trying padding.

    I wonder if this is related to the body .singular.

  2. Amy Hendrix (sabreuse)

    Posted 3 years ago #

    Try using p:first-of-type instead: the first-child selector applies to the first element in the div, not the first paragraph element.

  3. AardvarkGirl
    Posted 3 years ago #

    Amy... AMY AMY AMY. Dànké!!!

  4. Amy Hendrix (sabreuse)

    Posted 3 years ago #

    Bitte! Happy to help.

Topic Closed

This topic has been closed to new replies.

About this Topic