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.

Recommended Answers

All 5 Replies

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

but i have coded my pages in php and html

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>

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
}

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.