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

XF 1.4 Extra.css: !important

Discussion in 'Styling and Customization Questions' started by sgr, Aug 18, 2015.

  1. sgr

    sgr Active Member


    In a lot of situations I find myself using !important, as I'm unable to increase the specificity of the selectors as compared to the default css code inside XF templates.

    Is this good practice?

    How do people here use css code in extra.css to override css rules?

    For example, If I want to override rules inside of .node .subForumList li .nodeTitle, ID selector is not an option for such generic rules. I'm left with !important as the only method, or maybe find more enclosing classes to increase the specificity. Are there better methods?

    Stephen Fifty likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It should be possible to do increase specificity without using !important in most cases.
    Using !important however won't necessarily cause any problems.
    Stephen Fifty and sgr like this.

Share This Page