how to prevent div from resizing

S

scaredemz

i have a div, i set the innerHTML property to a formatted paragraph of
text. however, at times the text exceeds the width (and height) of the
div. how do i create a fixed width div and make it use a scrollbar if
the contents exceed the height and width specified. i'm using microsoft
visual studio, and i have the width explicitly set in the properties
but still on setting the innerHTML it resizes automatically. help pls.
thx.
 
E

Evertjan.

wrote on 10 dec 2005 in comp.lang.javascript:
i have a div, i set the innerHTML property to a formatted paragraph of
text. however, at times the text exceeds the width (and height) of the
div. how do i create a fixed width div and make it use a scrollbar if
the contents exceed the height and width specified. i'm using microsoft
visual studio, and i have the width explicitly set in the properties
but still on setting the innerHTML it resizes automatically. help pls.
thx.

use css overflow, overflow-x, overflow-y

Nothing to do with javascript.
Please follow up on a css NG.

example:

<div style='width:200px;overflow-x:scroll;'>
qwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwerty<br>
qwerty
</div>
 
E

Evertjan.

wrote on 10 dec 2005 in comp.lang.javascript:
so something i forgot to add - it works in IE but not in Firefox.

Where are you talking about?

please quote and show relevant code.
 
S

scaredemz

thx for the help. i'll transfer the problem to a css site. just
wondered if you could help me with this. the problem is this - the div
is a fixed height and a fixed width, i attach a paragraph of any length
to it. in IE, the paragraph is line-wrapped according to the width, and
if too long, a scroller appears. Firefox however, tries to put the
whole paragraph in one line and so I always have a horizontal scroller.
I'd like for it to line-wrap according to width and display only a
VERTICAL scroller if necessary. below is my div. thx for the help.


<DIV id="quoteDiv" style="OVERFLOW-X: scroll; FONT-WEIGHT: bold;
FONT-SIZE: 13pt; Z-INDEX: 101; LEFT: 0px; WIDTH: 296px; COLOR: red;
FONT-FAMILY: Arial; POSITION: absolute; TOP: 344px; HEIGHT: 290px"
ms_positioning="GridLayout">
<P id="quoteDivParagraph"></P>
</DIV>
 
E

Evertjan.

wrote on 10 dec 2005 in comp.lang.javascript:
thx for the help. i'll transfer the problem to a css site. just
wondered if you could help me with this. the problem is this - the div
is a fixed height and a fixed width, i attach a paragraph of any length

not if you do not quote where you are replying on, after all this is
usenet, not email, and if it is an css problem, please ask in a css NG.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top