Click to See Complete Forum and Search --> : overflow in div


csjanakas
08-10-2006, 06:12 AM
<html>
<head>
<title>Auto Scrolling Div</title>
<head>
<style type="text/css">
.div_scrol {
background-color: #CCCCCC;
padding: 10px;
border: 1px solid #993333;
height:120px;
overflow: scroll;
width: 80%;
font-size:80%;
margin-left:10%;
margin-right:10%;
scrollbar-face-color : midnightblue;

}

</style>
</head>
<body>

<div class="div_scrol" >
The following items are designated Product Identity, as defined in Section 1(e)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa
of the Open Game License Version 1.0a, and are subject to the conditions set
forth in Section 7 of the OGL, and are not Open Content: Dungeons & Dragons, D&D,
The following items are designated Product Identity, as defined in Section 1(e)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa
of the Open Game License Version 1.0a, and are subject to the conditions set
forth in Section 7 of the OGL, and are not Open Content: Dungeons & Dragons, D&D, The following items are designated Product Identity, as defined in Section 1(e)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa
of the Open Game License Version 1.0a, and are subject to the conditions set
forth in Section 7 of the OGL, and are not Open Content: Dungeons & Dragons, D&D,
forth in Section 7 of the OGL, and are not Open Content: Dungeons & Dragons, D&D,
The following items are designated Product Identity, as defined in Section 1(e)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa
of the Open Game License Version 1.0a, and are subject to the conditions set
forth in Section 7 of the OGL, and are not Open Content: Dungeons & Dragons, D&D, The following items are designated Product Identity, as defined in Section 1(e)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa
of the Open Game License Version 1.0a, and are subject to the conditions set
forth in Section 7 of the OGL, and are not Open Content: Dungeons & Dragons, D&D,

</div>




</body>
</html>


Problem

wht i need is when the text is less than 120px or less than 6 line, example 2 line area should be fit to that size.
now its same size even thought text is with 1000 line or single line.

i tried with max-lenght property but it doesn't work either.

help me.

regard
csjanakas :(

csjanakas
08-10-2006, 07:14 AM
i feel reader not get the problem clearly. I edit some text. check now.

wht i need is when the text is less than 120px or less than 6 line, example 2 line, div area should be fit to that size.it should not show 120px hieght that time.
now its same size even thought text is with 1000 line or single line.

KDLA
08-10-2006, 07:57 AM
Change your height to auto and get rid of the overflow: scroll.

height: auto;


KDLA

csjanakas
08-10-2006, 09:59 PM
when i put height as auto no scroll apper, when text line are exceed than 6 line. need is when text line are greater than 6 then scroll should appear, when text is less than 6 ex:2 line then the div hieght should be fit to that much.

regard
csjanakas

csjanakas
08-11-2006, 05:27 AM
I did it

<html>
<head>
<title>Auto Scrolling Div</title>
<head>
<script type="text/javascript">

function getDataCellColor(element)
{
var height = '90px';
document.writeln(element.fontsize);
if(element.innerText.length < 540)
{
height = 'auto';//(element.innerText.length)/6+'px';
//document.writeln(element.innerText.length);
}

return height;
}
</script>
</head>
<body>
<table><tr ><td >
<div style="background-color: #CCCCCC;border: 1px solid #993333;
height:expression(getDataCellColor(this));overflow:auto;width: 800px;font-size:80%;
margin-left:10%;margin-right:10%;scrollbar-face-color : midnightblue;" >
f the Open Game License Version 1.0a, and are subject to the condi tions setsssssssssss
sssssssssssssssssss forth in Section 7 of the OGL, and are not Open Content: Dungeons
f the Open Game License Version 1.0a, and are subject to the condi tions setsssssssssss
sssssssssssssssssss forth in Section 7 of the OGL, and are not Open Content: Dungeons f the Open Game License Version 1.0a, and are subject to the condi tions setsssssssssss
sssssssssssssssssss forth in Section 7 of the OGL, and are not Open Content: Dungeons f the Open Game License Version 1.0a, and are subject to the condi tions setsssssssssss
sssssssssssssssssss forth in Section 7 of the OGL, and are not Open Content: Dungeons
s forth in Section 7 of the OGL, and are not Open Content: Dungeons f the Open Game License Version 1.0a, and are subject to the condi tions setsssssssssss
sssssssssssssssssss forth in Section 7 of the OGL, and are not Open Content: Dungeons f the Open Game License Version 1.0a, and are subject to the condi tions setsssssssssss
sssssssssssssssssss forth in Section 7 of the OGL, and are not Open Content: Dungeons
</div>
</td>
</tr>



</table>
</body>
</html>