• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

CSS modifications on a module which has no own css styles?

Scheduled Pinned Locked Moved Custom CSS
30 Posts 2 Posters 688 Views 2 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.
  • S Away
    sdetweil @rkorell
    last edited by sdetweil Mar 24, 2025, 1:55 PM Mar 24, 2025, 1:44 PM

    @rkorell said in CSS modifications on a module which has no own css styles?:

    .MB-Wetter-Temp .module-content div {
    color: “fuchsia”;
    }

    SO close… the color is NOT in quotes (in css)
    sorry I missed that before

    .MB-Wetter-Wind .module-content div {
      color: blue;
    }
    

    Snip20250324_1.png

    here I am using the dev window to override the blue to red… see the top right of the right column , note that the one from custom.css (just below), is strikethru to say it is overridden by something higher up
    if you uncheck the checkbox in front of the color:red; it will disable that value and the strikethru will go away and the text will be blue

    Screenshot 2025-03-24 at 6.48.28 AM.png

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    R 2 Replies Last reply Mar 24, 2025, 2:42 PM Reply Quote 1
    • R Offline
      rkorell @sdetweil
      last edited by Mar 24, 2025, 2:42 PM

      @sdetweil said in CSS modifications on a module which has no own css styles?:

      dev window to override the blue to red

      I guess your own CSS modification has enabled this…
      Without this the entry #text doesn’t have any opportunity to change anything…

      S 1 Reply Last reply Mar 24, 2025, 2:47 PM Reply Quote 0
      • R Offline
        rkorell @sdetweil
        last edited by Mar 24, 2025, 2:43 PM

        @sdetweil said in CSS modifications on a module which has no own css styles?:

        SO close…

        :-)

        You’ve made my day!
        THANKS a LOT!!!

        1 Reply Last reply Reply Quote 0
        • S Away
          sdetweil @rkorell
          last edited by sdetweil Mar 24, 2025, 2:50 PM Mar 24, 2025, 2:47 PM

          @rkorell said in CSS modifications on a module which has no own css styles?:

          Without this the entry #text doesn’t have any opportunity to change anything…

          you are not styling the TEXT, you are styling the DIV that HOLDS the text
          (my css entry commented out, and the div selected)
          you cannot target the ‘text’ itself… only whatever holds it (p, div, span, table data…)

          Snip20250324_4.png

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          R 1 Reply Last reply Mar 24, 2025, 3:13 PM Reply Quote 0
          • R Offline
            rkorell @sdetweil
            last edited by rkorell Mar 24, 2025, 3:15 PM Mar 24, 2025, 3:13 PM

            @sdetweil said in CSS modifications on a module which has no own css styles?:

            you cannot target the ‘text’ itself…

            Yes, understood.
            What I cannot understand and what doesn’t work for me is exactly this, what you (formerly) asked and demosntrated in your last post: touch this div -part…
            what you DO have:

            ScreenFloat Bildschirmfoto von Google Chrome am 24_03_2025, 16_01_53 24_03_2025, 16-01-53.jpg

            I do NOT have ! (for whatever reason!)
            I have the

             <div class="module-content">
            

            the following

            <div style" color: red;">
            

            is not present in my developer’s console:

            ScreenFloat Bildschirmfoto von Google Chrome am 24_03_2025, 16_04_05 24_03_2025, 16-04-05.jpg

            ???

            Greetings,
            Ralf

            S 1 Reply Last reply Mar 24, 2025, 3:29 PM Reply Quote 0
            • S Away
              sdetweil @rkorell
              last edited by sdetweil Mar 24, 2025, 3:38 PM Mar 24, 2025, 3:29 PM

              @rkorell yes you do
              the full html of that section

              <div id="module_26_MMM-JsonValue" class="module MMM-JsonValue MB-Wetter-Wind MMM-JsonValue">
                   <header class="module-header" style="display: none;"></header>
                   <div class="module-content" style="color: red;">   // you are trying THIS div
                          <div>  // but it needs to be THIS div -------------
                             <span class="fa-solid fa-wind"></span>  Wind:  3.5 m/s
                          </div>
                   </div>
              </div>
              

              .MB-Wetter-Wind // the class name on the div id=
              .module-content // then the div with the module content class
              div // then the div that HOLDS the text value

              ..MB-Wetter-Wind  .module-content (means whatever element has this defined) div 
              

              could also do

              ..MB-Wetter-Wind  div.module-content (means ONLY A DIV with class, a span with the same class would not match)  div 
              

              many styles are NOT inherited DOWN the tree

              because the span holds the icon, you can remove it for css design consideration of the text

              <div id="module_26_MMM-JsonValue" class="module MMM-JsonValue MB-Wetter-Wind MMM-JsonValue">
                   <header class="module-header" style="display: none;"></header>
                   <div class="module-content" style="color: red;">   // you are trying THIS div
                         <div>  // but it needs to be THIS div -------------
                               Wind:  3.5 m/s
                         </div>
                   </div>
              </div>
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              S R 2 Replies Last reply Mar 24, 2025, 3:41 PM Reply Quote 0
              • S Away
                sdetweil @sdetweil
                last edited by sdetweil Mar 24, 2025, 3:41 PM Mar 24, 2025, 3:41 PM

                @rkorell I think your div has the class margin-block-end added (maybe thru custom.css)

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • R Offline
                  rkorell @sdetweil
                  last edited by rkorell Mar 24, 2025, 3:48 PM Mar 24, 2025, 3:45 PM

                  @sdetweil

                  <div id="module_11_MMM-JsonValue" class="module MMM-JsonValue MB-Wetter-Wind" style="opacity: 1; position: static;">
                  <header class="module-header" style="display: none;"></header>
                  <div class="module-content">
                  <div style="margin-block-end: -30px;">
                  <span class="fa-solid fa-wind"></span>  Wind:  &nbsp;&nbsp;4 m/s
                  </div>
                  </div>
                  </div>
                  
                  

                  Is my complete HTML block for this…
                  Interesting enough YOU do not have this

                  "margin-block-end: -30px;"
                  

                  in your HTML …
                  THIS style is hard coded in the *.js file of module…

                  I give up.
                  Problem solved…

                  THANK you SO much!

                  Ralf

                  S 1 Reply Last reply Mar 24, 2025, 3:48 PM Reply Quote 0
                  • S Away
                    sdetweil @rkorell
                    last edited by sdetweil Mar 24, 2025, 3:49 PM Mar 24, 2025, 3:48 PM

                    @rkorell said in CSS modifications on a module which has no own css styles?:

                    I give up.

                    but its the SAME result… you need to target the div INSIDE the module-content div

                    .module-content div {
                    color: …
                    }

                    this means
                    find the element(s) with class module-content
                    AND THEN
                    the div(s) inside that

                    selector is ALWAYS ALL that match

                    as the color style is not inherited down

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    R 1 Reply Last reply Mar 24, 2025, 3:58 PM Reply Quote 0
                    • R Offline
                      rkorell @sdetweil
                      last edited by Mar 24, 2025, 3:58 PM

                      @sdetweil You are - as always - right.
                      For some reasons NOW it works - tried again.
                      (And I already HAD tried exactly THIS dozens of times …).

                      THANKS!

                      Ralf

                      S 1 Reply Last reply Mar 24, 2025, 4:01 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      1 / 3
                      • First post
                        22/30
                        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