,讓我的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我已經更新了我的答案。 –