Skip to content
Advertisement

How to style echoed text?

I am trying to style the user, time and content. they only appear once the user has entered a comment into the website and so I cannot use <p> tags with inline CSS. any suggestions?

JavaScript

Advertisement

Answer

1- create a class in your css (i.e: myClass)

2- use echo like this: echo 'User: <span class="myClass">'.$row['user'].'</span></br>' ;

Edited:

html characters in php are like string! so you may concat them all like this:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement