tags:

views:

414

answers:

5

Hi,

In my code. I m having Div tag with the type = "hidden". I just dont want to show the div. Only if needed i will make it to show By JQuery Show() .

But still my div is not hidden from the view. Please suggest me.

Edit Now i make the DIv as hidden by using

            <div style="visibility:hidden" >XYZ</div>

If i need to show it again ..How can i do this....

+8  A: 

try using style instead of type

<div style="display: none;">content</div>
cobbal
+4  A: 
type="hidden"

is used only for hidden input textbox.

If you want to hide you div use :

style="display:none"

Or with JQuery hide your div with hide().

Canavar
+2  A: 

If the DIV isn't absolutely positioned, "display:none" can crash the overall structure of the document.
You may use:

<div style="visibility:hidden"></div>

This will make the DIV invisible.

MoRtiy
Just for clarification: While display:none "collapses" the particular element, visibility:hidden hides it while reserving the space for it in the layout.
DrJokepu
After i make it hidden , if i need to show the Div on click of a some Text .Jow can i do..
Aruna
A: 

By using style="display:none" , can hide the div

tummy.developer
+1  A: 

Use display: none to prevent the div from being displayed and layout space won't be reserved. Use visibility: hidden to simply hide it (like 0% opacity), but the necessary space will be reserved.

streetpc