Home › Forums › WoodMart support forum › Custon CSS not load correctly on first load of every page › Reply To: Custon CSS not load correctly on first load of every page
Aizaz Imtiaz Awan
Hello,
Custom code may not work after the initial page load unless the user has used a selector in their custom code that coincides with a theme selector they are trying to override. In such a case, it is necessary to increase the specificity of the custom selector so that it overrides the theme styles regardless of where the code is located.
For example, if you need to change the margin-bottom of a widget title class (.widgettitle, .widget-title https://monosnap.com/file/WWFinhb9isNIWLxCQiEb8bDWatzHfZ), the custom code should be written by strengthening the selector with an additional tag or class. In the following code example, the selector has been strengthened using the body tag.
WRONG:
.widgettitle, .widget-title {
margin-bottom: 10px;
}
CORRECT:
body .widgettitle, body .widget-title {
margin-bottom: 10px;
}
Best Regards