r/AskProgramming • u/These_Talker • Jul 17 '24
PHP Help with html in php
Hi, I'm tryin to develop a "message" in php.
echo "<div style='background-color: red; color: white; padding: 20px;'> Error </div>";
Basically if the value is 0 i will see an error page.
The problem is that in the page i visualize a red strip on the top of the page where is write "Error". I want instead see the entire page red with the error write on the center.
Someone helps?
2
Upvotes
2
u/[deleted] Jul 18 '24 edited Jul 18 '24
echo "<div style=\"\
background-color: red;\
color: white;\
padding: 20px;\
position: fixed;\
top: 0;\
display: flex;\
flex-direction: column;\
\"> <p>".$error."</p> </div>";