Drezard Posted March 9, 2007 Share Posted March 9, 2007 Hello, I have a class definition in a file called Class.php: class NEW { function DISPLAY() { echo "<p> Display </p>"; } } And then in a new file called use.php I have this code: <html> <head> <style type="text/css"> p {font-family: courier} </style> </head> <body> <?php include('class.php'); $CLASS = new NEW; $CLASS->DISPLAY(); ?> </body> </html> Okay, So it basically displays the word "Display". But, I wont it to display the word "display" in my style. How do i do it? - Cheers, Daniel Link to comment https://forums.phpfreaks.com/topic/42045-php-css/ Share on other sites More sharing options...
pocobueno1388 Posted March 9, 2007 Share Posted March 9, 2007 Exactly what is your style? It is displaying exactly how you put it... Link to comment https://forums.phpfreaks.com/topic/42045-php-css/#findComment-203907 Share on other sites More sharing options...
per1os Posted March 9, 2007 Share Posted March 9, 2007 <?php include('class.php'); $CLASS = new NEW; ?> <html> <head> <style type="text/css"> p {font-family: courier} <?= $CLASS->DISPLAY();?> </style> </head> <body> </body> </html> Is that what you are looking for? --FrosT Link to comment https://forums.phpfreaks.com/topic/42045-php-css/#findComment-203911 Share on other sites More sharing options...
Barand Posted March 9, 2007 Share Posted March 9, 2007 I had to change the name of your class to "NEWC" as new is reserved word, but that aside, your orig code works as it should. "Display" is displayed with courier font. Link to comment https://forums.phpfreaks.com/topic/42045-php-css/#findComment-203916 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.