80% of CSS developers couldn’t answer this question

Can you believe it? 80% of the developers who took ReSkill’s CSS test answered incorrectly or didn’t answer this question at all. Frankly, it’s not an easy one, but definitely a question that most  CSS developers should know the answer to.

What do ReSkill do?

ReSkill is a platform where you can evaluate your skills, read relevant professional articles, look at job opportunities and more. One of the platform’s most popular features is our skill tests.

Why skill tests? The main reason many people take tests is the need to advance their skills and enhance their chances of being employed. Overall, more than 250,000 questions were answered the last 2 months, and counting!

We were intrigued to know which question most of the developers couldn’t answer correctly.

So we took a look at our database and found a question that 75% answered incorrectly and another 5% didn’t answer at all because they ran out of time.

 

Here is The CSS Question:

What is the most efficient CSS selector to choose the first LI element?

 

Spoiler alert – how do you approach this question?

Your approach to answering and getting this question right demands that you take an in-depth look at how CSS works.

First thing to remember: CSS gets evaluated from right to left.

As an example, let’s look at the following CSS rule:

For every HTML element as it gets rendered to the page, it will first check if the element is of type LI. If so, it will work its way up the DOM and check if it‘s parent is a UL element with an ID of “content”. If it finds what it is looking for, it will continue its way up the DOM until it reaches the body.

The main important thing that we learn from how CSS is being evaluated is:

To determine which rule has better performance, you need to figure out how many nodes need to be evaluated to determine whether a style can be applied to an element.

The options for the correct answer were:

  1. .reskill {}
  2. ul > li {}
  3. ul li {}
  4. li:first-of-type {}

As we said, 80% didn’t know what the right answer is, do you? If so, take Reskill’s CSS test and even challenge your friends. Reskill CSS tests are designed, not only to sharpen your developer skills but to make you a professional. In fact, after you have taken them and excelled, you can always post them in your profile for all to see and take note of your rise in rank. Determination and commitment to excellence are key if you have to compete effectively in the current dispensation. Having your knowledge ranked against the best gives you a fresh impetus to work harder and do better in your career.  

  
Want to see how you score? Just click the button >>

Take the CSS TEST

About The Author

reskill

Howdy! I'm mypath's marketing and community manager. I love ice cream (any flavor will do), sleeping and making the company's KPI go up. If you have a neat idea for a blog post or want to ask me something, please connect me.

Close