-2

I have this echo, however I'm unsure how I'd style the echo with for instance a tag. I'd appreciate some examples.

echo $lastpireps['landingrate'];

Additionally, is there anyway of styling this echo through a css file?

4

2 回答 2

1

你可以这样做:

<div class="foo"><?php echo $lastpireps['landingrate']; ?></div>

或这个:

echo '<div class="foo">' . $lastpireps['landingrate'] . '</div>';

.foo然后像往常一样在你的CSS中设置样式。

于 2013-03-01T22:49:50.240 回答
0

有成千上万种方法。这是一个。

如果您处于 php 代码的块/循环中

echo "<div class='myclass'>".$lastpireps['landingrate']."</div>";

在 CSS 中

.myclass {}

于 2013-03-01T22:52:38.183 回答