Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
5
Answers
Why empty space is showing when a div visibilty is false
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Dorababu Meka
13y
1.6k
1
Reply
Hi all i am having 2 check boxes and 2 div's on my web page. On checking particular check box i will show the corresponding div to the user but if i show second div the space which was occupied by first div is occupying empty space why it is happening
Assume my structure is as follows
<div id="div1" runat="server"> <div> </div> </div>
<div id="div2" runat="server"> <div> </div> </div>
<asp:checkbox id="chk1" runat="server" text="Show Div1" autopostback=true />
<asp:checkbox id="chk2" runat="server" text="Show Div2" autopostback=true />
in code i am showing as follows for both the check boxes
if (chk1.Checked) { div1.Visible = true; } else { div1.Visible = false; }
if (chk2.Checked) { div2.Visible = true; } else { div2.Visible = false; }
Can any one tell how to resolve this
Sample Style applied for Div is as follows
.style1 { width: 268px; height: 19px; position: absolute; top: 16px; left: 335px; float: left; z-index: 1; }
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
How to implement google map by passing parameters by textbox using html javascript
Issue on Using Href