[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Hide a div embedded in a php page using only css

Posted on 2008-11-16
Medium Priority
Last Modified: 2012-05-05
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.
Question by:alicia1234
LVL 15

Accepted Solution

quincydude earned 500 total points
ID: 22973633

div#indexProductListCatDescription { visibility: hidden; }

also check if the original style of class "content" and id "indexProductListCatDescription" already contains some style about display or visibility.

Author Comment

ID: 22975645
      div#indexProductListCatDescription { visibility: hidden; }
did the trick.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses
Course of the Month19 days, 20 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question