Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
How to style php output? Here is an code for example? I can only style with css the code who is in the echo.How to style the session value?
echo "<h1>Logged in as:</h1>" .$_SESSION['myusername'];
Any tip?
session value
echo "<h1>Logged in as:" .$_SESSION['myusername']. "</h1>";
You can use span tag to format text inside h1 tag :
span
h1
echo "<h1 class='yourClass'>Logged in as:<span class='spanclass'>" .$_SESSION['myusername']. "</span></h1>"
CSS class (for example):
.spanclass{ color:green; }
Add a comment
Use class to you html in php and add a style to your css file
In css page
.yourClass{ //add your style }
In PHP
echo "<h1 class='yourClass'>Logged in as:</h1>" .$_SESSION['myusername'];
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
session valuealso in a element for ex: span or div and write inline cssecho "<h1>Logged in as:" .$_SESSION['myusername']. "</h1>";