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

Lack of Interest Add a CLASS to the body

Discussion in 'Closed Suggestions' started by Rigel Kentaurus, Oct 24, 2010.

  1. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    I have been editing PAGE_CONTAINER just to add
    <body class="myStyle">

    That is because I then can do really fine grained CSS definitions, and make sure those are only included for a specific style.

    Having the ability to set a class on the body tag would certainly be useful.
     
    napy8gen and anotheralias like this.
  2. anotheralias

    anotheralias Well-Known Member

    I didn't realize there was any way to add a class at all - thanks! :)
     
  3. Mike

    Mike XenForo Developer Staff Member

    Wouldn't defining that CSS as part of the style... only apply the rules to that style? I'm not following the example.
     
  4. Kier

    Kier XenForo Developer Staff Member

    I must agree with Mike, I'm failing to see the usefulness here?
     
  5. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    I am planning to include a single stylesheet in the page (same css file, even if different styles)

    I am aware that is probably not good for the page (bunch of styles not used), but maintenance wise it is easier to have just one master stylesheet with several definitions that will kick in when a certain style is active.

    I use it on certain sites like that ... then I only change the body class and the page looks completely different.
     
  6. Jordan Wax

    Jordan Wax Member

    The main usefulness I have found for adding a class or id to the body (id is really the way to go here, due to specificity) is the ability to add to the main stylesheet code like "body#this_one h1" etc. Depending on the amount of special css you are applying to a page it can be more efficient than adding another stylesheet call.
     

Share This Page