css-diner
css-diner copied to clipboard
How to do 16.
I can not do 16 level. I wrote apple, plate:only-child. It doesn't works. What is correct form.
With the selector
plate:only-child
you are selecting the plates that are the only child of their parents.
The solution for that level is
plate > :only-child
to remove the children of plate that are single children.
Thanks.
This was a nice tutorial. When I got to this, I used
plate pickle:only-child, apple:only-child
My question is why didn't this work?
plate apple:only-child, pickle:only-child
Your first selector
plate pickle:only-child, apple:only-child
works in level 16.
But with your second selector
plate apple:only-child, pickle:only-child
you are selecting also de pickle on the bento
I found that this works too...
plate apple, plate pickle
Of course, it does not use the first-child.
I can not do 16 level. I wrote apple, plate:only-child. It doesn't works. What is correct form.
After I read the MDN about :only-child, I know the reason why plate:only-child doesn't works is that :only-child need a spacing before. plate :only-child is correct.
plate *:only-child
this also work but is this the correct way of doing it?
plate apple,pickle:only-child
why it's not working
plate apple,pickle:only-childwhy it's not working
Because a pickle is also the only-child of a bento. So you end up selecting those 2.
My answer is
plate apple:only-child, plate pickle:only-child
And it's working.
and you can write: "plate>apple, plate>pinckle" === "plate>:only-child"
My answer is: plate [SPACE] :only-child. Leave a blank space between "plate" and ":only-child"