Can't get .logoheader background-color to change using user.css Topic is solved

Everything to do with Joomla! 3.x templates and templating.
Post Reply
abramesd
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Apr 17, 2018 5:10 pm

Can't get .logoheader background-color to change using user.css

Post by abramesd » Wed Aug 19, 2020 11:55 pm

Hello ALL,

I am a bit of a newbie to Joomla and I am using Joomla version 3.9.20

My test site url is https://nernmra.org/test

My template is a copy of the beez3 template

What I am trying to do is set the background color of the Logo section but it is not working for me.

This is the code in my user.css file: (located in my template "css" folder)

Code: Select all

/* logo header */
.logoheader {
   background-color: rgba(128, 0, 0, 1);
}

but when I view the page I see that this code from the user.css file is overridden by some inline code (see the attached screen capture "Logoheader.png")

I have been able to trace this back to this bit of code in the "index.php" file in my template

Code: Select all


if ($color === 'image')
{
	$this->addStyleDeclaration("
	.logoheader {
		background: url('" . $this->baseurl . "/" . htmlspecialchars($headerImage) . "') no-repeat right;
	}
	body {
		background: " . $this->params->get('backgroundcolor') . ";
	}");
}

// Check for a custom CSS file
JHtml::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

If I comment out the code within the "if ($color === 'image')" block then my code in the user.css file can take effect.

I searched though the forum here and from what I can determine I am doing this correctly but I guess there is something going on I don't understand. If someone could provide some guidance or direct me to another topic that explains this problem and how to solve it, I would greatly appreciate the assistance.

Thank you
David
You do not have the required permissions to view the files attached to this post.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13136
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Can't get .logoheader background-color to change using user.css

Post by toivo » Thu Aug 20, 2020 12:29 am

The following code in user.css will do the trick:

Code: Select all

/* logo header */
.logoheader {
   background-color: rgba(128, 0, 0, 1) !important;
}
Toivo Talikka, Global Moderator

abramesd
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Apr 17, 2018 5:10 pm

Re: Can't get .logoheader background-color to change using user.css

Post by abramesd » Thu Aug 20, 2020 11:49 am

Thank you very much!

I guess I should have also said I was a newbie with CSS as well.

I will look that up as I suspect there are more cool attributes like that.

Thank you again

David


Post Reply

Return to “Templates for Joomla! 3.x”