Change the background color of a block


#1

Hello,

I need to change the background color of a block made of 6 rows. I have created a custom class, I have assigned it to the block and changed the background color in the custom class.

If i switch to view mode, it works, the color is changed regularly.

If i preview in browser or if I export the site, the color is NOT changed, remains the standard white.

On the contrary, if i change the background color on the block panel on the right hand side, the change affects all blocks above.

Any idea to solve this inconsistency?
Thanks,
dan


#2

In 2.4.5 it works, gues it´s the same in 2.5

I could only imagine that you might have given the Bloc a class - This would have an influence.


#3

Thanks for replying.

Yes, I have given the block a class and then changed its background color but it does not work.

What’s wrong?

Please help,
Dan


#4

Do you cleared already the cache of your browser? If this not helps, do you have a link of your website and how do you named the class?


#5

Thanks for helping. I have cleared the cache.

I do not have a link yet.

I named the class “social_block”.

The strange is that when I toggle the view mode, everything is correct, i.e. the background color is changed as I want.

When I preview in browser, it is not changed and it is the standard white.

Have I made any mistake?

Thanks!


#6

Without a link it is hard to say why this is the case.


#7

The all and ever point.
Did you clear your Browser Cache?!


#8

Unfortunately yes, I did clear the cache, I tried with two browsers, Safari and Firefox.

Another info, I am trying to change the background color of a block in the bottom global area where I put LinkedIn and Facebook links.

Might this be the problem?

Thanks,


#9

So sorrry, as I am a Non coder.
It works fine here on my site, never ever had a problem.

Hope you can sort it with the help of others.

Great people are here in the forum!


#10

What I have noticed is that in the sidebar the color of the block is the standard white despite the fact I have changed it in the custom class assigned to the block.

It seems to be linked to a Global Watch but I do not find the cross to unlink it!


#11

Classes are the inner core of blocs!
Just learn how to use them and fiddle arround :slight_smile:
You will learn to love it!


#12

The best way to control Bloc colours is with Global Swatches. If you require a class it’s only best to use these to apply gradients.

Blocs and rows both support global classes and are by default auto set to the white swatch. Blocs currently can’t have their colour set to transparent.

The colour well in the sidebar is related to global swatches not classes.

It sounds like the class colour is being overidden by the global swatch. Why not just use a global swatch? It will only effect a single bloc, are you sure you don’t have multiple rows in a single Bloc?


#13

Hello Norm,
thanks!

I have found the problems, I had not 100% understood the behavior of Global Swatches, now it works perfectly.

Again thanks!