Jump to content

font size problem


Pavlos1316

Recommended Posts

Hi all..

 

I was given this code to display a msg the first time a user logs in.

 

<?php
if (!$_SESSION['firsttime']) {
   echo "<center><font size=10><font color=#00FFFF><font weight=bold>Welcome</font></font></font></center>";
   $_SESSION['firsttime'] = true;
}
?>

 

Everything is working exept the <font size>. What ever I do is not changing.

 

Any ideas why?

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/
Share on other sites

this isn't a PHP problem as such. However....

 

Try this:

<?php
if (!$_SESSION['firsttime']) {
   echo <<<_WELCOME
<center><font size="10" color="#00FFFF" weight="bold>Welcome</font></center>
_WELCOME;
   $_SESSION['firsttime'] = true;
}
?>

 

Regards ACE

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599276
Share on other sites

if (!$_SESSION['firsttime']) {
echo "<span style=\"text-align:center; font-size:10; color:#00FFFF; font-weight:bold;\">Welcome</span>";
$_SESSION['firsttime'] = true;
}

 

<span> won't let you center the text because it's not a block element. Using <div> would work though:

 

if (!$_SESSION['firsttime']) {
echo "<div style=\"text-align:center; font-size:10; color:#00FFFF; font-weight:bold;\">Welcome</div>";
$_SESSION['firsttime'] = true;
}

 

Just saving another question if Pavlos decides to use this way.

Link to comment
https://forums.phpfreaks.com/topic/116546-font-size-problem/#findComment-599420
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.