Jump to content

hi   

2 members have voted

  1. 1. hi

    • font size??
      1
    • someone help please
      1


Recommended Posts

How do you normally set a font-size?

 

Are you required to use the div tag? Why not make it easier to just use the <font> tag? No styling required, unless that is what the assignment calls for.

 

Look up on the <font> tag in html to see how it is used. From there, you can hopefully find out. If not read up on echo and print on how to print/echo variables in PHP.

Link to comment
https://forums.phpfreaks.com/topic/144623-text-size-in-php/#findComment-758904
Share on other sites

If you want it to go from small to large:

 

<?php
session_start();
$start = 1;
$top   = 24;
if( !isset($_SESSION['size']) )
{
   echo '<font size="'.$start.'">We start with 1.</font><br><br>Please refresh page';
   $_SESSION['size'] = 2;
}
else if($_SESSION['size'] == $top)
{
   echo '<font size="'.$_SESSION['siz'].'">We end our font size with '.$top.'</font>';
}
else if($_SESSION['size'] > $top)
{
   echo '<font size="'.$_SESSION['size'].'">Next Size: '.$_SESSION['size'].'</font><br><br>Please refresh page';
   $_SESSION['size']++;
}
?>

 

Of course here is a random size:

 

<?php
$size = rand(1,24);
echo '<font size="'.$size.'">Our random size font is '.$size.'</font><br><br>Please refresh page';
?>

Link to comment
https://forums.phpfreaks.com/topic/144623-text-size-in-php/#findComment-758906
Share on other sites

Besides that, font tag is deprecated. So dont use it.

 

For an assignment, as long as the teacher does not care, I would use it.

 

My bad :P

 

np, the problem arises is when someone actually does use that code, which a teacher can generally tell a beginners code from someone who knows php code and they start searching, find this topic and wham, he is in trouble for that. I do understand that, it would really be his problem, but by just helping him along, a teacher would not punish them for that and they learn it.

 

Some times just pointing out the right direction is great :)

 

But it is like the old saying, "You give a mouse a cookie....", you keep giving him stuff and he keeps wanting you to give him more, you teach him it, he learns it and will learn how to find solutions on his own.

Link to comment
https://forums.phpfreaks.com/topic/144623-text-size-in-php/#findComment-758915
Share on other sites

But it is like the old saying, "You give a mouse a cookie....", you keep giving him stuff and he keeps wanting you to give him more, you teach him it, he learns it and will learn how to find solutions on his own.

 

Ive only heard the term "You give a mouse a cookie.. he will ask for milk" :lol:

Link to comment
https://forums.phpfreaks.com/topic/144623-text-size-in-php/#findComment-759076
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.