Forum Moderators: open

Message Too Old, No Replies

<BR> ' s dissapearing

         

natty

10:01 am on Apr 10, 2003 (gmt 0)

10+ Year Member



hi all,

having some problems with divs and BR tags going walkies..
i have a form split into afew blocks. each block is encapsulated with a div. on selecting a dropdown , certain divs will dissapear, using the display = none.
each block is separated with a single <br> tag, which is fine.. until i pick one of these dropdowns to make the bits dissapear, then a br tag does a runner, and the blocks squish together..
all the blocks and divs are all done the same way , yet only one of the <br>'s stops working.
i have also substituted the <br> for some text, which also dissapears, although if i grab a selection across the page, it has the text in the clipboard..
most confusing

the html..


<div id='blah'>
dropdowns...
<div id='blah2'>
stuff in this div will do a display = none in certain circumstances.
</div>
</div>
<br> <!-- <<<--- this is the tag that is going walkies -->
<div id='ret_blah'>
dropdowns..
<div id='ret_blah2'>
as above will dissapear sometimes..
</div>
</div>

and the js


id = blah2; <!--for instance...-->
if (some test){
divs = document.getElementsByTagName("div");
divs[id].style.display = 'none';
}

Nick_W

10:05 am on Apr 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmmm... don't know JS but a possible workaround untill you work out whats wrong with your client-side code would be to give those divs margins rather than line-breaks.

div {
margin-bottom: 2em;
}

Nick

le_gber

10:06 am on Apr 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure you haven't enclosed the <br> into a <div> tag?

leo

natty

10:20 am on Apr 10, 2003 (gmt 0)

10+ Year Member



hi again all,

ive given the divs a border to see if i can make more sense of it, but it all seems to be fine.
cant give the divs a bottom margin, as it wont work in NN4.. :o
any other ideas..?
the most strange thing is that there are 4 of these div 'blocks' on the page, and its only doing it on one of them..
arrrggghghhghgh
this is sposed to be fun.. :(