Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Harold Provens
1,701 PointsHiding unused information on a website.
Hey Guys,
I am new to html and css, but I am currently working on a web page that includes a portfolio section that I want to hide for the time being. I plan on using it in the future after I figure out some bugs. Is there a simple way to hide this section in the html or css instead of deleting it? Thanks for your help!
Rick
Ian Svoboda
16,639 PointsI didn't realize, but the hash symbol was not included in my post ( the # symbol).
1 Answer
James Barnett
39,199 Points@Harold -
I think you are thinking of comments.
<!-- I'm an HTML comment -->
/* I'm a CSS comment */
Here's some more info on them.
HTML and CSS give you the ability to leave comments within the code. These comments can be used to help with organization, set reminders, and manage code more effectively. Comments become especially useful when there are multiple people working on the same code. Any content wrapped within comments will not be rendered on the page.
HTML comments wrap the content starting with
<!--and end with-->. CSS comments wrap the content starting with/*and end with*/.
source: Comments within HTML & CSS section this tutorial
Harold Provens
1,701 PointsThanks so much for the help!
Ian Svoboda
16,639 PointsIan Svoboda
16,639 PointsHello Harold,
The simple option here would be to use CSS. You have two options on how to "hide" the content and the selector should point to the container in both cases.
Option 1: Completely remove the element and it's contents from the document (webpage)
IdOfYourContainer {
display: none; }
Option 2: Make the element and it's contents invisible and allow the container to still exist in the document flow*
IdOfYourContainer {
visibility: hidden; }
*This basically means that the page layout will be unaffected however the element and it's contents will be invisible.