user3727055 user3727055 - 1 year ago 89
HTML Question

How to hide a div on certain pages using CSS

I have just finished creating my new template layout for my website. I want to use the same layout on my login page, but there are two divs that use use the URL CSS coding for images, but I dont want them to be shown on the login page.
How can I hide these divs using CSS without using a

tag in the login page to over ride the CSS file?

Here is an example of the basic layout:

example css{
background-image: url("paper.gif");

<div class="example div">

Now all I want is that example
to not show in login.php.
Please note that I'm using PHP include to grab my template files for my website.
Another idea, could I do something like this?

div example{

Answer Source

you can use style as a property of a div

<div class="example div" style="visibility:hidden;">

this will require to create a new layout .

or you can just use this js code in the login page


and just add an id for the div. or you might use getElementsByClassName.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download