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

XF 1.4 Hiding Elements - CSS. vs Removing/Commenting Out

Amaury

Well-known member
#1
Just a general query.

I know either way works--which means the "if it works, then it doesn't really matter" comes into play here--but when it come to wanting to hide things like the forum list title, the likes bar, etc., what's generally better?

CSS:

Code:
.forum_list .titleBar h1 {
    display: none;
}
Or removing/commenting out in the corresponding template:

Code:
<xen:comment><xen:h1>{$xenOptions.boardTitle}</xen:h1></xen:comment>
 

Brogan

XenForo moderator
Staff member
#2
If you don't want it rendered in the output, comment it out.

A browser inspector will allow hidden elements to be seen.
 

Dylan V

Well-known member
#5
I generally prefer to hide elements with the CSS, because it's much faster. I don't really feel the difference to comment or hide an element with the CSS. It's like it was the same thing.
 

James

Well-known member
#6
I generally prefer to hide elements with the CSS, because it's much faster. I don't really feel the difference to comment or hide an element with the CSS. It's like it was the same thing.
If you comment with xen:comment then that code is not rendered at all and doesn't appear in the output of the page. If you hide with css or html comments then that information is still accessible via the page source.
 

Dylan V

Well-known member
#7
If you comment with xen:comment then that code is not rendered at all and doesn't appear in the output of the page. If you hide with css or html comments then that information is still accessible via the page source.
Yes, I know, but I prefer hide with CSS.
 
Last edited: