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.

    Extreme basic question!

    Scheduled Pinned Locked Moved Custom CSS
    3 Posts 2 Posters 932 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.
    • C Offline
      chris_d
      last edited by

      I’ve written my own module to display a set of family tasks which rotate each week.
      Once I’ve done some javascript to build a string of HTML, I display with.

              var element = document.createElement("div")
              element.className = "myContent
              element.innerHTML = output;
              return element
      
      

      I just want to format this element with an existing magic mirror class so that the text doesn’t look massive and out of place, say “title” for example. But I can’t work out how to actually achieve that.

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @chris_d
        last edited by sdetweil

        @chris_d in custom.css

         .module_name .classname {
           font-size:. ?????
        }
        

        .module_name is your module name
        . classname is .myContent
        fix the missing " in your posted text

        note the dot in front. that means class
        no dot means element name (div, table. li, …)
        # means id

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @sdetweil
          last edited by sdetweil

          @chris_d

          the string of things before the {

          is called the selector clause.

          this gives u the ability to ‘select’ the html elements you want to apply the styles to

          I use this cheat sheet to view the different choices
          https://www.w3schools.com/cssref/css_selectors.php

          the selector can be very complex

          here is one from my MMM-Config module

          .possibly-hidden-tab div:nth-child(2)  > div > div >div >ul >li:only-child >a[rel*="Item 1"] {
            display: none;
          }
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 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