Insert HTML Code !important

Hi,
I use the html bric and a html code. I ask the developer if its possible that the code use the h1-h5 and paragraph settings I set in blocs. He said I should use !important ?! Ok, but how ? Where? I can’t tell me this because he dont use blocs app …
any ideas?
thanks tom

!important can only be used in manually added CSS codes. Blocs itself will not be able to do this for you.

I thought it is possible to use !important in the code bric as inline style.

@tom2 it may someday come to the app.

But presently you will need to implement things manually as the others have stated.

Hi,
thank you all for your help. I am not a coding expert… How I can implement !important in the code that the code use my H1 and so on… Is this complicated ?

Nothing complicated to it. You just overwrite the CSS code Blocs created with your own adjustments in the code editor. Below a sample on how it could look like (depending on what you want to achieve)

<style>
 {
    width: 20px!important;
    height: 20px!important;
    border-radius: 100%!important;
    border-width: 2px!important;
    border-style: solid!important;
	border-color: #f0f0f0!important;
    background-color: #616190!important;

}
</style>

Hi @Jerry
Thanks. But is there a way to say for example H1 is important. So blocsapp use the settings I set for H1 in blocsapp. Not to type all the specific infos for example size , color etc
Sorry for my bad English. Hard to explain :blush:
Tom

You can set all your object for text like you want to in the project settings for your website for all the breakpoints if you wish in the project settings under typography. It’s what I do if I know how I want my typography to behave before a start designing the site in Blocs.

I think this is what you want to achieve?

Ive

Hi @tom2,

The !important suffix is applied to the end of each class style, not the class itself.

With very little detail supplied about your problem, it does appear that what ever code you are using has classes applied that are overriding your own ones, and the !important suffix stops your style being overridden. What ever CSS style is applied last wins, except using it.

Hi @Ive251068
Thanks, yes I also will do that first. But the code I insert do not use my h1 settings …
thanks
Tom

Hi @Malachiman
Ok, thanks for your help. I will check what classes the code use. Thanks for the explanation
Tom

Can you please provide us more information so we can help sorting out what the problem is. Maybe an example of what you putting in the html editor? Or what you trying to do? It’s helps track back your problem.

I am not on my computer. So I don’t see the Code. But, I insert a code by a developer to show some dates. Thinks like bike tours… a type of calendar.
The backend is by the developer and I only insert the code with the html bric in blocs App. I set all my font and size for each h1/h2/h3…/p inside blocs app. but the insert code use not my fonts. So @Malachiman said some classes overwrite my classes. And now I want to find a solution so the insert html code use my fonts … sorry, for my English :grimacing: not the best
Tom

Im suggesting it is possible. You haven’t provided any details. We can only guess.

I’m guessing he’s using some sort of widget where he can not edit the css code and is forced to use !important on his own classes. Like you said we can only guess for the moment

Do you think it helps when you see the code ?
I am later on my Mac.

Hi…
this is the code I use. The XXXX is the specific ID from my client …

what do you think ?

You can try this, in Blocs, go to Code Editor and if this script is only on one page, use the selection dropdown and pick Page-Header. When this opens, copy and paste this code below:

h1,h2,h3,h4,h5,h6,p,label,.btn,a{ font-family:"Gotham Medium"!important; }

Now change Gotham Medium to the font family you are using on this page. This should override all fonts on the page. If you only want certain ones like h1 and h2 to be a certain font family, delete the other choices as needed. Example:

h1,h2{ font-family:"Gotham Medium"!important; }

Remember to change to the font family you are using. Hope this solves your issue. Enjoy!

Hi @gp2727
Thanks for your help. I will give it a try. Do I don’t need style tags ?
Tom

Yes, you will need style tags. Image example…