Hiding text in a <div>

windows

Guest
I need to place some text in a <div></div> area of a document, but I need the text to be invisible (because a script on the page needs to read it at some time). How do I do that? I am using IE. I can make no assumptions about background colors and such (so making it the same color as the background won't work).<br />
<br />
Thanks.<br />
<br />
Deltareum<!--content-->how about:<br />
<br />
<span style="display:none;">all hidden content</span><br />
<br />
or put it in the div tag to hide the whole div<br />
<br />
dave<!--content--><div id="mydiv" style="visibility:hidden"><!--content-->deltareum: the difference between these is that display:none will not display the text, so it won't affect the layout. visibility:hidden hides it, so it will alter your layout.<br />
<br />
(I couldn't remember the value for visibility offhand which was why i didn't post it)<br />
<br />
dave<!--content-->Thanks! You people are the greatest!<br />
<br />
I am using <div style="display:none;"> now and it works like a champ.<br />
<br />
What versions of IE and Netscape will this work with?<br />
<br />
Deltareum<!--content-->What versions of IE and Netscape will this work with?<br />
IE4+, NS4+<br />
However, both insert a blank line.<br />
<br />
IE5+ and NS6+ do not insert a blank line (which is appropriate behavior)<!--content-->M$ IE 6.0 fails and inserts a blank line under some circumstances, when it shouldn't the same went for Opera 6.0 but in Opera 7.xx the problem was resolved.<br />
<br />
So M$ has buggy support for display:none;.<!--content-->
 
Back
Top