Span tag

I watched named span tags video. But I did not understand that 6:58 You have put SPAN TAG okay. But I can see there is too many span tag inside of the HTML element. After that, you have gone into the style which was named CSS. Then you just type logo span and color

Hi @bitblaster92433,

We have something called “selectors” in css to select certain tags and style them. Here to select that certain “span” tag we are using combinators, A specific combinator called descendant selector.
image

When in code we write this -
nav span {} - It means we are selecting all span tags inside of nav element.
.logo span{} - It means we are selecting all spans inside of an element with class logo.

Selectors: Brief Theory -

  • You can select an element using the tag name.
  • You can select an element with an ID
  • You can select all elements using * (universal selector)
  • You select an element using the attribute.
  • You can select multiple elements using Selector list if they have same styles to be applied.
  • If you want to select an element inside of another element,or there is a sibling element or you want to target deeply nested elements inside of an element , You use combinators.
  • You can also select an element based on certain state (called pseudo selectors)



For Combinators check this -

For Pseudo Selector -

Other important topics to pick on -

Inheritance
Specificity, Specificity Calculator
Cascading

.

I mean Why span tag did not effect to other span tags? How computer can understand that?

When in code we write this -
nav span {} - It means we are selecting all span tags inside of nav element.
.logo span{} - It means we are selecting all spans inside of an element with class logo.

Is that the answer?

by the way I could not see any span tag at your helpful pictures. So can I do all these things without use span tag?

Hi @bitblaster92433,

nav span {} It means we are only targeting span tags inside of nav element, if there are any other spans (say outside of the nav), the style would not be applied on them.

Somebody is able to answer this query, please?