How can CSS be used to adjust the layout of elements generated by PHP scripts?

When using PHP scripts to generate elements on a webpage, CSS can be used to adjust the layout of these elements. By adding classes or IDs to the generated elements in the PHP script, specific CSS rules can be applied to style and position them on the page. This allows for greater control over the appearance and layout of dynamically generated content.

<?php
// PHP script generating elements with specific classes
echo '<div class="generated-element">Element 1</div>';
echo '<div class="generated-element">Element 2</div>';
echo '<div class="generated-element">Element 3</div>';
?>
```

```css
/* CSS to style generated elements */
.generated-element {
  background-color: #f2f2f2;
  padding: 10px;
  margin: 5px;
  border: 1px solid #ccc;
}