PDA

View Full Version : Positioning Text


gselvara
09-03-2002, 05:23 AM
Hi,
I have given some html code below. In that the text within the paragraph tag gets compressed when I resize the browser window. Please tell me that this can be stopped. I cant use tables in any way because I have to be able to move text around the page. I have noticed though that the input tags dont get compressed.

Thanks,
Gavin

<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>

<INPUT type="text" id=text1 name=text1 style="position:absolute;top:10;left:10;">
<INPUT type="text" id=text1 name=text1 style="position:absolute;top:10;left:180;">

<P style="position:relative;top:10%;left:30%;">Hello Thi is a text : </P>

</BODY>
</HTML>

joh6nn
09-03-2002, 05:53 AM
<P style="position:relative;

you have to change that to absolute, like it is in the input tags.

<P style="position:absolute;top:10%;left:30%;">Hello Thi is a text : </P>

gselvara
09-03-2002, 12:01 PM
joh6nn,
Hi, thanks for the reply. But the code you gave getts compressed when the browser is resized. But a colegue of mine has shown me another way to avoid this. If i put the text inside a div tag the problem doesnt occur.

Thanks,
Gavin

<HTML>
<HEAD>

<TITLE></TITLE>
</HEAD>
<BODY>

<DIV STYLE="position:absolute; width:400px; height:300px; left:200;top:200; background-color:red">
<P style="position:absolute;top:10%;left:30%;">Hello Thi is a text : </P>
</DIV>


</BODY>
</HTML>