What does "" mean in CSS selectors? [duplicate]

0

Galera, I came across this CSS of a free project that I downloaded from the web.

.user-panel>.image>img {}
  • What does this "nested" notation represent?
  • Why "img" does not have the period (.)?
  • asked by anonymous 19.08.2017 / 15:58

    2 answers

    2

    Points are used for classes. HTML elements are only used with your name. The > symbol means immediate descendant.

    Other ways to read this selector would look like this:

    elemento com classe "user-panel" 
        que tem um descendente direto 
            elemento com classe "image"
                que tem um descendente direto
                    elemento HTML "img"
    

    CSS rules will apply only to the img element that respects this HTML hierarchy / clutter.

    In HTML it could be:

    <div class="user-panel">
        <div class="image">
           <img src="..." />
    
        
    19.08.2017 / 16:03
    1

    This selector means:

      

    Select all elements with the .user-panel class, then select all direct children with the class .image , then select all direct children that are < strong> img .

    That is:

    • .user-panel : Selector per class
    • > : Direct descendant (child) indicator
    • .image : Selector per class
    • > : Direct descendant (child) indicator
    • img : Selector by tag

    References:

    19.08.2017 / 16:03