Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I style my text inside an echo?

Tags:

html

css

php

echo

Part of the code is

while ($row = mysqli_fetch_assoc($result))
                    {
                        echo "$row[firstname] $row[lastname]";
                        echo "<hr>";
                        echo "<strong>Date Referred:</strong>&emsp;&emsp;&emsp;&emsp;&emsp;$row[cf_831]";
                        echo "<br/>";
                        echo "<strong>Date Today:</strong>&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&emsp;$today"; 
                        echo "<br/>";
                    } 

How do I style this part for example?

"$row[firstname] $row[lastname]"
like image 643
Prth Avatar asked Jul 07 '15 07:07

Prth


1 Answers

You can try

echo '<p class="mystyle">' . $row['firstname'] . " " . $row['lastname'] . '</p>';

Then add CSS

.mystyle {

}
like image 130
Siddharth Thevaril Avatar answered Oct 06 '22 01:10

Siddharth Thevaril