• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Xenforo syntax to inherit built-in css class already declared or styled using style properties?

RoldanLT

Well-known member
#1
Like I want to create a new css class but want to inherit some a built-in class.

Code:
.CustomCssClassHere{
@sectionHeaders
/* my custom css goes here */
}
Is it possible?
 

MagnusB

Well-known member
#3
I don't understand what you want to do? Normally, you would just use the original class, then add another custom class and use the custom class to whatever custom css you want to add.
 

RoldanLT

Well-known member
#4
Let say I have a custom html template.

Code:
<div style="CustomCssClassHere">
Custom Content
</div>
But I want to use the properties of the built-in xenforo class .sectionHeaders
and add some of my custom css style.

Can I do that?
Just like xenforo template, if you include it.
Code:
<xen:include template="ExistingTemplate" />
 

MagnusB

Well-known member
#5
Just use the class, if it doesn't work, try to include the css file with the class you want to include. Think sectionHeaders is one that is included on most pages though.
 

MagnusB

Well-known member
#9
If you want a protip; If you want something to apply to only CustomCssClassHere along with sectionHeader, use:
Code:
.CustomCssClassHere.sectionHeader {}
I usually make a sport out of not using !important with CSS, as they can create unforeseen complications when you depend on inheritance.
 

RoldanLT

Well-known member
#10
If you want a protip; If you want something to apply to only CustomCssClassHere along with sectionHeader, use:
Code:
.CustomCssClassHere.sectionHeader {}
I usually make a sport out of not using !important with CSS, as they can create unforeseen complications when you depend on inheritance.
Thanks for the tips.i will try that later on my desktop.