• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 554
  • Last Modified:

Hide a div embedded in a php page using only css

I'm making some custom mods to Zen Cart. In one of the php files, this code displays a category description on the screen:

<div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description;  ?></div>
<?php } // categories_description ?>

I don't want the description to show. I know that I can just add a "//" in front of the echo, and that gets rid of it. But I'd rather do it in the css file.

I thought I could just add this line to the css file:

div#indexProductListCatDescription { display: none; }

But it doesn't work. The description still shows.
1 Solution

div#indexProductListCatDescription { visibility: hidden; }

also check if the original style of class "content" and id "indexProductListCatDescription" already contains some style about display or visibility.
alicia1234Author Commented:
      div#indexProductListCatDescription { visibility: hidden; }
did the trick.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now