Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with DIV

Status
Not open for further replies.

safra

Technical User
Jan 24, 2001
319
NL
Hi,

let's say you have a div tag without contents.
step 1: When the page is loaded this div tag will not 'claim' space in the window.

step 2: div tag has contents through user action

step 3: div tag goes back to no contents through user action

Now the div tag is claiming space (1 line).

Is there a way to get rid of this line like as if the case when the page finished loading?

Regards,

Ron
 
I don't believe there is, since the <div> tag is sort of like the <p> tag like that -- it has a built in <br>, of sorts.

You can, however, use <span> tags, to achieve a like effect, and it has no linebreak with it.

:)
Paul Prewett
 
you can set the divs display property like so (IE only):

function changeContents(val)
{
if(val==&quot;&quot;)
{
thedivobject.style.display='none';
}
else
{
thedivobject.style.display='block';
}
thedivobject.innerText = val;
} jared@eae.net -
 
Thanks both of you, I will try your suggestions!

Regards,

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top