XF 2.2 Trying to hide a HTML widget under a certain page width

Nicolas FR

Well-known member
Hello,

This is what i wrote in extra.less template:
Less:
@media (max-width: @xf-responsiveWide) {
    [data-widget-id="25"] {
        display: none;
    }
}
Where 25 is the Widget ID i created.
But it doesn't works...
I try to replace [data-widget-id="25"] by [data-widget-key="quick_options"] but still not works.

Where is my mistake ?
Thanks
 
Last edited:
Solution
There is no way of targeting it in CSS - there is no unique class or ID.

You will need an alternative approach such as this - ensure you check the Advanced mode option.

1602544672504.webp

HTML:
@media (max-width: @xf-responsiveWide) {
    .myWidget {
        display: none;
    }
}
There is no way of targeting it in CSS - there is no unique class or ID.

You will need an alternative approach such as this - ensure you check the Advanced mode option.

1602544672504.webp

HTML:
@media (max-width: @xf-responsiveWide) {
    .myWidget {
        display: none;
    }
}
 
Solution
Top Bottom