,让我的echo语句和白色,怎么给一个蓝色的文字文本echo语句,例如更改文本颜色与可变
<?php
$testo = file_get_contents('testi.txt');
echo $testo;
?>
TXT文件是由许多像这样的例子链接
<a href='https://www.example.com/playlist/film1.mp4' target='blank'>Example text1</a><br/>
,让我的echo语句和白色,怎么给一个蓝色的文字文本echo语句,例如更改文本颜色与可变
<?php
$testo = file_get_contents('testi.txt');
echo $testo;
?>
TXT文件是由许多像这样的例子链接
<a href='https://www.example.com/playlist/film1.mp4' target='blank'>Example text1</a><br/>
无需php
这里,使用css
:
a:link { color:#0000FF; text-decoration:none; font-weight:normal; }
a:visited { color: #0000FF; text-decoration:none; font-weight:normal; }
a:hover { color: #0000FF; text-decoration:underline; font-weight:normal; }
a:active { color: #0000FF; text-decoration:none; font-weight:normal; }
基于OP的评论更新:
有several ways to add css
to your file,为简单起见,这里是一个例子:
<?php
$links = file_get_contents("links_from_text_add_css.txt");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
a:link { color:#0000FF; text-decoration:none; font-weight:normal; }
a:visited { color: #0000FF; text-decoration:none; font-weight:normal; }
a:hover { color: #0000FF; text-decoration:underline; font-weight:normal; }
a:active { color: #0000FF; text-decoration:none; font-weight:normal; }
</style>
</head>
<body>
<?=$links?>
</body>
</html>
使用belowcode希望这将有助于你
<?php
$testo = file_get_contents('testi.txt');
echo "<p style=\"color:#000\">".$testo."</p>";
?>
我如何应用css打印彩色链接到视频 – Miguel
@Miguel我已经更新了我的答案。 –