2 Use inline code for selectors to make it clear where the commas and quotes go.
source | link

I've been learning HTML5/CSS3 for a month now, and I've built my first demo website. At first I was using a lot of the element selectors like: '>', '>,' ,, '+'+ in combination with the type names for selecting nested tags.

Now I've moved more to the id and class selectors and use the '>', '>,' ,, '+'+ less often for selecting nested tags.

Is using id and class selectors a better approach for selecting tags which are (deeply) nested? Are there any downsides to this approach? Or is it just a matter of style?

I've been learning HTML5/CSS3 for a month now, and I've built my first demo website. At first I was using a lot of the element selectors like: '>', ',', '+' in combination with the type names for selecting nested tags.

Now I've moved more to the id and class selectors and use the '>', ',', '+' less often for selecting nested tags.

Is using id and class selectors a better approach for selecting tags which are (deeply) nested? Are there any downsides to this approach? Or is it just a matter of style?

I've been learning HTML5/CSS3 for a month now, and I've built my first demo website. At first I was using a lot of the element selectors like: >, ,, + in combination with the type names for selecting nested tags.

Now I've moved more to the id and class selectors and use the >, ,, + less often for selecting nested tags.

Is using id and class selectors a better approach for selecting tags which are (deeply) nested? Are there any downsides to this approach? Or is it just a matter of style?

1
source | link

CSS: When to use which selector

I've been learning HTML5/CSS3 for a month now, and I've built my first demo website. At first I was using a lot of the element selectors like: '>', ',', '+' in combination with the type names for selecting nested tags.

Now I've moved more to the id and class selectors and use the '>', ',', '+' less often for selecting nested tags.

Is using id and class selectors a better approach for selecting tags which are (deeply) nested? Are there any downsides to this approach? Or is it just a matter of style?