Topic: Why nothing seems to work? Can\'t replace image in default template.
Stanley Davenport pro asked 7 years ago
Josip Tomašev pro premium priority answered 7 years ago
Your problem has a simple solution
If you change your CSS:
.view {
background: <img src="/images/solar-panel-on-grass-hut-roof.jpg" class="img-fluid" alt="solar hut"> no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
in something like:
.view {
background: url("/images/solar-panel-on-grass-hut-roof.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
and everything will work as it should :)
Best regards
Josip
Stanley Davenport pro commented 7 years ago
Thank you. That worked. I just cannot use the alt or img-fluid syntax. I have a lot to learn. ThanksStanley Davenport pro commented 7 years ago
With the JS 4.4.4 update the image is gone again. Any reason why this would happen?Josip Tomašev pro premium priority commented 7 years ago
I suppose you mean MDB 4.4.4? I have tried your html with a corrected css class .view, with Free and with Pro version, and the page works flawlessly.Stanley Davenport pro commented 7 years ago
I was referring to the java script subfolder in the 4.4.4 update. I took the files from the updated folders and copied them over the existing files in the previous version. Could you please explain about the .view as that is in my code as well. Thank YouJosip Tomašev pro premium priority commented 7 years ago
I copied css, js, and font directories from the official zip file (version 4.4.4) into my test directory, copied your html to index.html and opened it in the web browser. I created a directory images and added an image with the same name as in the css class .view. And everything works properly. Did you copy css and js directories (and replaced all files) into your working directory?Stanley Davenport pro commented 7 years ago
At first only the js folder. Now that I have copied all folders over the index file is working. Is this what I must do every single time we get an update? Thank You.Josip Tomašev pro premium priority commented 7 years ago
Yes, mdb.css and mdb.js must go together. And they have to go with the corresponding versions of bootstrap.css and bootstrap.js because the MDB mostly tracks changes in Botstrap, from version to version.Stanley Davenport pro commented 7 years ago
OK. All is working again now. I have so much to understand and the classes I am taking often get bogged down in tangents. Thank you for your help. I really appreciate it.Josip Tomašev pro premium priority commented 7 years ago
I'm glad I helped :)Marta Szymanska staff pro premium answered 7 years ago
Stanley Davenport pro answered 7 years ago
Stanley Davenport pro answered 7 years ago
Josip Tomašev pro premium priority commented 7 years ago
And one small tip: never rewrite new versions of css / js that are online before you've tried off-line. Specifically, bootstrap is still in development, and between versions there are differences (new css classes, changed and / or abolished existing css class), and MDB tracks those changes. So that there may be something in your code that is no longer defined in bootstrap / MDB so you can "kill" the site that is now working. Always test on your local computer before uploading to a production server.FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No