Background-image does not appear

Everything to do with Joomla! 5.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
nagaho2
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Feb 15, 2024 10:03 pm

Background-image does not appear

Post by nagaho2 » Tue Feb 27, 2024 5:59 pm

Adding a background-image within a custom module only seems to work if I use the options section when setting up the module. The image did not display if I only put it in the user.css using the custom module class.

I want to try using a background image under all the top modules.

Checking the forum I found a suggestion, from last year, to define the body class.
.body {background-color:#000;
background-image: url("/images/guitar_neck_blue2.png");
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
background-position: left top;
}

However, as with the custom modules, the image does not appear at all, and isn't listed in the code with Chrome view source or inspect elements.


website: https://environment.johnboukis.com/blog/

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1611
Joined: Tue Jun 30, 2020 12:17 pm

Re: Background-image does not appear

Post by Pavel-ww » Wed Feb 28, 2024 7:05 am

nagaho2 wrote:
Tue Feb 27, 2024 5:59 pm

.body {background-color:#000;
background-image: url("/images/guitar_neck_blue2.png");
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
background-position: left top;
}
Hi.

These are only your mistakes.

1) Remove the dot before .body {...}. body is not a class but a tag.
1.jpg
--


2) /images/guitar_neck_blue2.png this is not the right path to the image. It is 404.
https://environment.johnboukis.com/imag ... _blue2.png

You can get right path to the image in media manager
You do not have the required permissions to view the files attached to this post.

nagaho2
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Feb 15, 2024 10:03 pm

Re: Background-image does not appear

Post by nagaho2 » Wed Feb 28, 2024 3:10 pm

Thank you.

nagaho2
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Feb 15, 2024 10:03 pm

Re: Background-image does not appear

Post by nagaho2 » Wed Feb 28, 2024 4:15 pm

That works great, except it appears under the menu section and below, instead of from the absolute top.

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1611
Joined: Tue Jun 30, 2020 12:17 pm

Re: Background-image does not appear

Post by Pavel-ww » Thu Feb 29, 2024 7:05 am

nagaho2 wrote:
Wed Feb 28, 2024 4:15 pm
That works great, except it appears under the menu section and below, instead of from the absolute top.
Because of this
1.jpg
You do not have the required permissions to view the files attached to this post.

nagaho2
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Feb 15, 2024 10:03 pm

Re: Background-image does not appear

Post by nagaho2 » Thu Feb 29, 2024 10:11 pm

Thanks but no, that doesn't change anything. That class wasn't even added to user.css until after I tried and removed the body code. I tried putting a background image in there but that didn't work either, even without the background-color.

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1611
Joined: Tue Jun 30, 2020 12:17 pm

Re: Background-image does not appear

Post by Pavel-ww » Fri Mar 01, 2024 7:29 am

nagaho2 wrote:
Thu Feb 29, 2024 10:11 pm
Thanks but no, that doesn't change anything. That class wasn't even added to user.css until after I tried and removed the body code. I tried putting a background image in there but that didn't work either, even without the background-color.
Hi. Since you delete all changes before getting an answer here, it is very difficult to help you. Return all your changes back, then I can determine your problem.


Post Reply

Return to “Templates for Joomla! 5.x”