• 0

[CSS] Hide a div


Question

Heya guys.

I'm trying to make a <div> that shows up when you click on another <div>.

Using css I'm telling the second <div> to have no heihth and to be hidden.

On the first <div> I have an onclick event that setts the visiblity of the 2nd <div> to show and the heigth to 100%

Here's the source code.

&lt;div onclick="javascript:document.getElementById('make_comment').style.visibility = 'visible'; document.getElementById('make_comment').style.height = '100%';"&gt;Click here&lt;/div&gt;
	&lt;div id="make_comment" style="visibility:hidden; height:0px;"&gt;

	&lt;table align="center"&gt;
	&lt;tr&gt;
	&lt;td&gt;bla bla bla&lt;/td&gt;
	&lt;/tr&gt;
	&lt;/table&gt;

	&lt;/div&gt;

It works the way I want in Firefox.

But in IE, the height of the 2nd <div> is always 100% it doesn't make it smaller!

How can I get it to work in both browsers?

Thank you!!!

k0zy

Link to comment
https://www.neowin.net/forum/topic/283063-css-hide-a-div/
Share on other sites

4 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.