-6

I need to know how to change the font size of the output of an echo. I already have a different font colour in the code, and it's making it more complicated for a noob like me. The echo should be in black and a size like 150%. Please write out the full code for it, and if anyone could teach me how it could be done would really help me out. Thanks.

<?php
srand (microtime()*10000);
$f_contents = file ("secretnet.txt");
$line = $f_contents[array_rand ($f_contents)];
echo "<font color='black'>$line</font>";
?>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Rulen24
  • 3
  • 1
  • 4

2 Answers2

0

This should do the trick, but like others have mentioned using CSS ( with a style sheet preferably ) instead would be ideal.

<?php
srand (microtime()*10000);
$f_contents = file ("secretnet.txt");
$line = $f_contents[array_rand ($f_contents)];
echo "<div style='font-size:150%; color:#000000'>" .  $line . "</div>";
?>

It'd look something like this if you're using a style sheet. If you need help with those I'd recommend posting in the CSS section of the site.

<?php
srand (microtime()*10000);
$f_contents = file ("secretnet.txt");
$line = $f_contents[array_rand ($f_contents)];
echo "<div class='your_class_name_here'>" .  $line . "</div>";
?>
rm80
  • 11
  • 1
0

in your php file:

<?php
srand (microtime()*10000);
$f_contents = file ("secretnet.txt");
$line = $f_contents[array_rand ($f_contents)];
echo "<div class='awesomeText'>$line</div>";
?>

In your file: style.css which need to be included as a linked resource on top of your page.

.awesomeText {
    color: #000;
    font-size: 150%;
}

Here is a quick sample: http://jsfiddle.net/qro9r54t/

Didier Aupest
  • 3,227
  • 2
  • 23
  • 35