πŸ€‘ Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! πŸš€start learning today!

🌟 Dreaming of a bright future? πŸŽ“ Ask about the Treehouse Scholarship program! πŸš€

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Community Projects
    • Live Sessions
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Community Projects Live Sessions Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
  • Stephen Drake
    Stephen Drake
    784 Points

    :only child confused

    Posted July 15, 2023 10:49am by Stephen Drake
    Stephen Drake
    784 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    2 Answers

  • Yoko Iseki
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Yoko Iseki
    Front End Web Development Techdegree Student 7,524 Points

    Why "Item 1" is not affected by :only-child?

    Posted August 24, 2022 8:56pm by Yoko Iseki
    .a{fill-rule:evenodd;}techdegree
    Yoko Iseki
    Front End Web Development Techdegree Student 7,524 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    2 Answers

  • Eddie Harmon
    Eddie Harmon
    17,094 Points

    Unexpected result when using :empty

    Posted June 23, 2020 11:32pm by Eddie Harmon
    Eddie Harmon
    17,094 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    1 Answer

  • Jake Almendarez
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jake Almendarez
    Front End Web Development Techdegree Student 4,250 Points

    for some reason the font size is still applied to all the elements even if after i add h1 and span tags.

    Posted June 12, 2020 3:46am by Jake Almendarez
    .a{fill-rule:evenodd;}techdegree
    Jake Almendarez
    Front End Web Development Techdegree Student 4,250 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    2 Answers

  • Sam Weeks
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Sam Weeks
    Front End Web Development Techdegree Student 16,699 Points

    :only child, tad confused...

    Posted January 23, 2020 3:04pm by Sam Weeks
    .a{fill-rule:evenodd;}techdegree
    Sam Weeks
    Front End Web Development Techdegree Student 16,699 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    3 Answers

  • Adam Duffy
    Adam Duffy
    4,466 Points

    :only-child psuedo class not displaying properly in Chrome.

    Posted September 2, 2019 9:07pm by Adam Duffy
    Adam Duffy
    4,466 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    2 Answers

  • James King
    James King
    5,529 Points

    Trouble Understanding :only-child

    Posted January 30, 2018 9:51pm by James King
    James King
    5,529 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    1 Answer

  • Aakash Srivastav
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Aakash Srivastav
    Full Stack JavaScript Techdegree Student 11,638 Points

    :only-child

    Posted January 12, 2018 8:21am by Aakash Srivastav
    .a{fill-rule:evenodd;}techdegree
    Aakash Srivastav
    Full Stack JavaScript Techdegree Student 11,638 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    1 Answer

  • Aakash Srivastav
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Aakash Srivastav
    Full Stack JavaScript Techdegree Student 11,638 Points

    :empty

    Posted January 12, 2018 7:10am by Aakash Srivastav
    .a{fill-rule:evenodd;}techdegree
    Aakash Srivastav
    Full Stack JavaScript Techdegree Student 11,638 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    1 Answer

  • bobdeei
    bobdeei
    8,575 Points

    :only-child no working as expected?

    Posted December 26, 2017 4:05am by bobdeei
    bobdeei
    8,575 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    1 Answer

  • Luca Di Pinto
    Luca Di Pinto
    8,051 Points

    Need help! Can you explain me bette how :only-child works??

    Posted September 27, 2016 8:59pm by Luca Di Pinto
    Luca Di Pinto
    8,051 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    2 Answers

  • Ross Alejandro Bendal
    Ross Alejandro Bendal
    8,993 Points

    I did a :empty and expect it to affect my <h1></h1>, but it did not. Any ideas why?

    Posted July 2, 2016 10:17am by Ross Alejandro Bendal
    Ross Alejandro Bendal
    8,993 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    2 Answers

  • Malcolm Stretten
    Malcolm Stretten
    3,814 Points

    can't make only-child code work

    Posted June 24, 2016 1:54pm by Malcolm Stretten
    Malcolm Stretten
    3,814 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    7 Answers

  • Francis N
    Francis N
    10,376 Points

    many people are concerned that chrome doesnt support :only-child but in the video, Guil is using Chrome....

    Posted February 6, 2016 2:22am by Francis N
    Francis N
    10,376 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    6 Answers

  • Dennis Marquez
    PLUS
    Dennis Marquez
    Courses Plus Student 2,791 Points

    My :empty doesn't work in Google Chrome. Any ideas?

    Posted November 24, 2015 5:31pm by Dennis Marquez
    Dennis Marquez
    Courses Plus Student 2,791 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    3 Answers

  • Sean Flanagan
    Sean Flanagan
    33,236 Points

    Why does my h1 appear on the left of the browser?

    Posted May 26, 2015 12:23pm by Sean Flanagan
    Sean Flanagan
    33,236 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    4 Answers

  • Richard Walton
    Richard Walton
    10,861 Points

    Different from video?

    Posted April 30, 2015 9:55am by Richard Walton
    Richard Walton
    10,861 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    1 Answer

  • Alexander Melo
    Alexander Melo
    4,297 Points

    Having Trouble with :only-child.

    Posted March 19, 2015 1:01am by Alexander Melo
    Alexander Melo
    4,297 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    12 Answers

  • MichaΕ‚ Gonciarz
    MichaΕ‚ Gonciarz
    13,549 Points

    Only child doesn't work

    Posted March 5, 2015 7:11pm by MichaΕ‚ Gonciarz
    MichaΕ‚ Gonciarz
    13,549 Points
    • CSS
    • CSS Selectors
    • Going Further with Attribute Selectors and Pseudo-Classes
    • :only-child and :empty

    10 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.