...

View Full Version : can div's be hidden



itsonlybarney
03-11-2005, 12:38 AM
how can i hide <div>'s???

cfc
03-11-2005, 12:49 AM
<style type="text/css">
div {
display: none;
}
</style>


With even minimal CSS knowledge you should be able to figure out what you need from that :)

brothercake
03-11-2005, 01:21 AM
Be aware though that non-displayed content is not accessible to most browser-based screenreaders. If the div has content, you'd be better to use "offleft positioning" - moving the element off the page so that it's still rendered, and accessible to readers, but with no physical impact on the visual layout:


div.offleft {
position:absolute;
left:-10000px;
}

itsonlybarney
03-12-2005, 11:08 PM
<style type="text/css">
div {
display: none;
}
</style>


the above hides all divs right? is it possible to hide all the <div>'s except for certain ones??

Graft-Creative
03-13-2005, 01:33 AM
I think:



<style type="text/css">
div#nav #content #sidebar #whatever #whatever {
display: none;
}
</style>


You could also try giving the divs a height of 0px and setting the overflow to 'hidden' - though I'm quite new to that particular technique and there may be a bit more to it than that.

Kind regards,

Gary

whizard
03-13-2005, 02:19 AM
What about
visibility:hidden? Dan

shlagish
03-13-2005, 05:27 AM
visibility: hidden is a no. I think it either doesn't work or only works with certain browsers.

If you want to hide every div exept one, you could do this:

div { display: none; }
div#ThatSpecialDiv { display: block; }

itsonlybarney
03-13-2005, 05:44 AM
Thanks works perfectly



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum