Click to See Complete Forum and Search --> : How do I hide navigation elements using print css styles?


graham241
05-03-2006, 05:38 PM
Greetings!

I am in the process of making a print style sheet for a site that I am working on that is using JavaScript for its navigation. I need to keep this html, but want to hide it with CSS, is this possible?

Here is the code I want to "hide":

<script language="JavaScript" src="menu.js" type="text/javascript"></script>

:rolleyes:

pcthug
05-03-2006, 06:50 PM
Why are you using Javascript for your menu? ~10% of your viewers will not even be able to access your menu leaving them stranded on a singular page.

http://www.alistapart.com/articles/goingtoprint/

graham241
05-03-2006, 07:18 PM
First of all it is not my personal site, and I know better. Second, I am perfectly aware of A List Apart, and that article. So in essence, you did not answer any of my questions, instead you tried to insult my intelligence.

The person I am working for does not want a restructuring of the code until later (something I cannot control) and therefore, need to work with what I have. So are you going to help me or not?

ray326
05-03-2006, 11:41 PM
display:none

pcthug
05-04-2006, 01:31 AM
I would not regard my last comment as insult your intelligence, but rather educating. No where in your original post do you mention that you are aware of the flaws of Javascript and the article that I linked to fully explains the practices of hiding with CSS.

The following syntax would be used assuming your menu is displayed in a div, id entitled menu.

<style type="text/css">
#menu {display:none} /* You may also use visibility:hidden, however the menu would still take up virtual space */
</style>

graham241
05-04-2006, 01:26 PM
Indeed. Didn't mean to confuse...thanks for the help!