如何更改我的 php 的颜色和字体大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33926699/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change the color and font size of my php?
提问by darkwing
I've been looking for ways to change the size and font of my php code output and can't find a way that doesn't cause errors. I want all of the following php code to appear white and enlarged:
我一直在寻找更改 php 代码输出的大小和字体的方法,但找不到不会导致错误的方法。我希望以下所有 php 代码都显示为白色并放大:
<?php
if (isset($_SESSION['something'])) {
echo "Welcome " . $_SESSION['something'] . ", <a href='something.php'>something</a>";
}
?>
If anyone can help me with with achieving this that'd be great. So far I've tried font-color and color-span but neither have worked.
如果有人可以帮助我实现这一目标,那就太好了。到目前为止,我已经尝试过 font-color 和 color-span,但都没有奏效。
回答by Milkmannetje
Wrap your code into a span or div tag, and apply some CSS styling to it.
将您的代码包装到 span 或 div 标签中,并对其应用一些 CSS 样式。
For example:
例如:
<?php
if (isset($_SESSION['something'])){
echo '<span style="color: white; font-size: 20px;">Welcome ' . $_SESSION['something'] . ', <a href="something.php">something</a></span>';
}
?>