Select Language:
If you’re trying to figure out how to hide comments on a website like GitHub, here’s a simple solution. Sometimes, comments can be distracting or unnecessary, and hiding them can make your viewing experience cleaner.
You can hide comments using your browser’s developer tools. Here’s how:
First, right-click on a comment you want to hide and select “Inspect” or “Inspect Element” from the menu. This opens the developer tools panel and highlights the comment’s HTML code.
Look for the section in the HTML that contains the comment. It might look like a <div> or <section> with specific classes or IDs. Once you find it, you can add a new style to hide this element.
In the developer tools panel, go to the “Elements” tab, then find the code for the comment. Right-click on that block and choose “Add Attribute” or directly modify the style by adding display: none;.
Alternatively, for a more permanent solution, you can use a browser extension like Stylish or Stylus. These allow you to write custom CSS that applies every time you visit the site. Here’s a quick example:
css
/ Hide comments with specific class or ID /
.comment-section {
display: none !important;
}
Replace .comment-section with the actual class or ID of the comment container you want to hide.
By applying these steps, you can easily hide comments and customize your viewing experience. Just remember, if the website updates its layout or class names, you might need to adjust your custom styles accordingly.




