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.

    custom.css ......body???

    Scheduled Pinned Locked Moved Custom CSS
    42 Posts 3 Posters 7.5k 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.
    • P Offline
      piki
      last edited by

      Re: CSS 101 - Getting started with CSS and understanding how CSS works

      I can’t change the background to MagiMirror. I need to put one image (file) there that will be loaded from the SD card. I also changed through css…but none of it works. If I change only the color it works…but the photo from the file does not. I checked the path name of the address books…but it still doesn’t work. Isn’t it necessary to add something? Thanks for any advice.

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

        @piki the MM webserver root is the MagicMirror folder, you cannot load anything from outside that folder tree thru the local server file:/// doesn’t work either

        http://localhost:MM-port/  
        

        points to the MagicMirror folder

        SO, you can make a LINK to the file into the MM folder

        see the ln command
        sudo ln -s source dest

        source is where it is
        dest is where you want it to appear

        also, see the second link in my signature below, or using the developers window elements tab to check on the contents and play with/test styles on elements

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          piki @sdetweil
          last edited by

          @sdetweil so via custom.css as I read it won’t work over time?

          1 Reply Last reply Reply Quote 0
          • P Offline
            piki
            last edited by

            or it won’t work only through custom .css?

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

              @piki IF you make the file to appear (copy or link) IN the MM tree THEN you can make it work thru css only

              the MM http server is configured ONLY for the MagicMirror tree and forward…
              not just anywhere in the file system

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • P Offline
                piki
                last edited by

                but in which line in the tree should I edit (configure) just write the path there…or?

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

                  @piki sorry, don’t understand the question

                  put your file in ~/MagicMirror

                  then your css url will be
                  http://localhost:mm_config_port (usually 8080)/filename(whatever the name of the file is in the MagicMirror folder)

                  http://localhost:8080/somefile.jpg
                  or whatever you call it

                  if you don’t want to copy it then

                  cd ~/MagicMirror
                  sudo ln -s /wherever_the_actual_file_is somefile.jpg

                  that will create a link for the file (from the booted sd card) to the MagicMirror folder
                  as somefile.jpg

                  you can name it whatever you want with whatever type it is: gif, png, jpg…

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    piki
                    last edited by

                    sku.jpg (its my file) and is found in MagicMirror/sku.jpg

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

                      @piki so
                      http://localhost:8080/sku.jpg

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        piki
                        last edited by

                        http://localhost:8080/sku.jpg

                        and should I enter that in custom .css?

                        body {
                        background-image : url(‘http://localhost:8080/sku.jpg.’);
                        background-size: cover;

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

                          @piki yes,
                          you should be able to use the developers window to add that to test out

                          select the body element and add in top right

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            piki
                            last edited by

                            I copied it directly into custom .css…but it still doesn’t work

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

                              @piki can you show the custom.css entry

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              1 Reply Last reply Reply Quote 0
                              • P Offline
                                piki
                                last edited by

                                body {
                                background-image : uurl(‘http://localhost:8080/sku.jpg.’);
                                background-size: cover;

                                }

                                S 2 Replies Last reply Reply Quote 0
                                • S Do not disturb
                                  sdetweil @piki
                                  last edited by

                                  @piki said in custom.css ......body???:

                                  uurl

                                  only url

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  1 Reply Last reply Reply Quote 0
                                  • P Offline
                                    piki
                                    last edited by

                                    I fixed it, but the image still doesn’t appear

                                    body {
                                    background-image : url(‘http://localhost:8080/sku.jpg.’);
                                    background-size: cover;

                                    }

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

                                      @piki and if you open the developers window, elements tab , select the body element

                                      is the css selected
                                      and are there any errors? (in the console tab)

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

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

                                        @piki said in custom.css ......body???:

                                        /sku.jpg.');

                                        you also have a trailing . in the image name, ‘jpg.’

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        1 Reply Last reply Reply Quote 0
                                        • P Offline
                                          piki
                                          last edited by

                                          Failed to load resource: the server responded with a status of 404 (Not found) sku.jpg.:1

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

                                            @piki still the trailing comma
                                            but, I tested here, needs to be in a subfolder of MagicMirror, config worked

                                            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
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • 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