0

hi,
Is it possible to adjust the text size acclording to the page size in html? actually i have a webpage where i output the value of some command. the output may differ from time to time. now i want that if my output is long it should adjust the text size such that the user when viewing doesn't have to use the vertical scroll bar? is it possible? any help will be appreciated.

5
Contributors
5
Replies
6
Views
10 Years
Discussion Span
Last Post by Troy III
0

use java script.
check tha size of output and accordingly adjust the element.Styel.Font property through javascript.

0

You can still use JavaScript within PHP and HTML. On the output of your page you're going to want this:

<html>
     <head>
          <meta name="whatever" content="whatever">
          <title>Your Title</title>
          <link rel="stylesheet" type="text/css" href="style.css">
          <script language="JavaScript" type="text/javascript">
           scriptstring;
          </script>
     </head>
     <body>
          your content
     </body>
</html>
0

first u need to make a default value for total character ( example $c = 100 depend on your layout )
then u can check total character in your output with php,

$total = strlen($your_output);
if($total > $c){
use smaller style
}else{
use normal style
}

0

hi,
Is it possible to adjust the text size acclording to the page size in html? actually i have a webpage where i output the value of some command. the output may differ from time to time. now i want that if my output is long it should adjust the text size such that the user when viewing doesn't have to use the vertical scroll bar? is it possible? any help will be appreciated.

Why don't you allow a line-break instead?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.