What is the best practice for styling PHP output with CSS?

When styling PHP output with CSS, it is best practice to separate the HTML markup from the PHP logic. This can be achieved by using PHP to generate dynamic content and then applying CSS styles to the HTML elements. By keeping the presentation separate from the logic, it makes the code more maintainable and easier to update.

<?php
// PHP logic to generate dynamic content
$dynamicContent = "Hello, World!";
?>

<!DOCTYPE html>
<html>
<head>
    <style>
        /* CSS styles */
        body {
            font-family: Arial, sans-serif;
            text-align: center;
        }
        .message {
            color: blue;
            font-size: 24px;
        }
    </style>
</head>
<body>
    <div class="message">
        <?php echo $dynamicContent; ?>
    </div>
</body>
</html>