Skip to content
Advertisement

Style MySQL Output in PHP with CSS

I have a MySQL Database and it prints live ne activities with PHP on my website. Now I like to style these text outputs (color, position, size) but I don’t know how. Do you have any ideas?

JavaScript
The first question/issue is solved!

Second question: I like to margin-top the img but it does not work. The height and width worked well but margin-top has no effect. Does anyone have an idea?

JavaScript

Advertisement

Answer

You need to wrap your PHP output in HTML, then you can style it as you would any other HTML element.

JavaScript

CSS

JavaScript

Edit ———-

Please try the above code exactly. Including the CSS. It looks like your CSS may be throwing off your display, as from a PHP perspective, this should work.

Here’s an example of it working in PHP playground: https://www.tehplayground.com/0aSiTkueB3pS1Fl4

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