MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Generic CSS question when target is several layers down

    Scheduled Pinned Locked Moved Custom CSS
    9 Posts 4 Posters 1.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ankonaskiff17A Offline
      ankonaskiff17
      last edited by ankonaskiff17

      How does one address what appears to be an attribute amenable to custom CSS tweaking when the item is several layers down as shown in attached picture? I figure it has to do with the crude example I sketched out below but not sure what is driver for when you insert spaces, or don’t.
      I see CSS that is
      .X.Y.Z {
      padding-left: 20px;
      }
      While other times it may be

      .X.Y .Z {
      padding-left: 20px;
      }
      Generic CSS.jpg

      S mumblebajM ? 5 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @ankonaskiff17
        last edited by sdetweil

        @ankonaskiff17 you have to chain together different selectors to target the element you want

        see
        https://www.w3schools.com/cssref/css_selectors.asp

        is id, module_1_calendar

        . is class , .module, .small
        neither is element name , aka div, img, li

        and there are operators that give u parent or child or direct child

        u currently cannot target an element with a specific value

        <li>2</li>
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • mumblebajM Offline
          mumblebaj Module Developer @ankonaskiff17
          last edited by

          @ankonaskiff17 Not an expert in CSS at all but in the first example you gave you are targeting a single element in the chain (.X.Y.Z single element Z in the chain of X/Y) whereas in the second example you are targeting two different elements (.X.Y and .Z).

          Check out my modules at: https://github.com/mumblebaj?tab=repositories

          1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @ankonaskiff17
            last edited by

            @ankonaskiff17 on the spaces question, it’s like immediate child with no space

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @ankonaskiff17
              last edited by

              @ankonaskiff17 if u select an element in the center panel then it’s lieneage is shown on the bottom of that pane

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User @ankonaskiff17
                last edited by

                This post is deleted!
                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @Guest
                  last edited by

                  @hango because he has multiple instances of calendar running, he needs to use the ID

                  #module_1_calendar
                  instead of the class
                  ,calendar

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  ? 1 Reply Last reply Reply Quote 0
                  • ? Offline
                    A Former User @sdetweil
                    last edited by A Former User

                    This post is deleted!
                    S 1 Reply Last reply Reply Quote 1
                    • S Offline
                      sdetweil @Guest
                      last edited by

                      @hango said in Generic CSS question when target is several layers down:

                      if he put something between clock and calendar or change position the ID is changing

                      good point… I hadn’t thought of classes for that kind of purpose…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy