我做错了什么“滚动文字栏”

I'm trying to read text file and show the result in scrolling message bar

But it doesn't work I don't know why! This is my whole code CSS HTML and the PHP side:

The CSS side work but there is no text inside the bar at all.

I tried other methods like marquee in HTML but it's not smooth like this one.

<style style="text/css">
.scroll-slow {
 height: 20px;  
 overflow: hidden;
 position: relative;
 background: gray;
 color: white;
 border: 1px solid gray;
}
.scroll-slow p {
 position: absolute;
 width: 100%;
 height: 100%;
 margin: 0;
 line-height: 20px;
 text-align: center;
 /* Starting position */
 -moz-transform:translateX(100%);
 -webkit-transform:translateX(100%);    
 transform:translateX(100%);
 /* Apply animation to this element */  
 -moz-animation: scroll-slow 25s linear infinite;
 -webkit-animation: scroll-slow 25s linear infinite;
 animation: scroll-slow 25s linear infinite;
}
/* Move it (define the animation) */
@-moz-keyframes scroll-slow {
 0%   { -moz-transform: translateX(100%); }
 100% { -moz-transform: translateX(-100%); }
}
@-webkit-keyframes scroll-slow {
 0%   { -webkit-transform: translateX(100%); }
 100% { -webkit-transform: translateX(-100%); }
}
@keyframes scroll-slow {
 0%   { 
 -moz-transform: translateX(100%); /* Browser bug fix */
 -webkit-transform: translateX(100%); /* Browser bug fix */
 transform: translateX(100%);       
 }
 100% { 
 -moz-transform: translateX(-100%); /* Browser bug fix */
 -webkit-transform: translateX(-100%); /* Browser bug fix */
 transform: translateX(-100%); 
 }
}
</style>



<!DOCTYPE html>
<html>
<body>
<div class="scroll-slow">
<?php
$myfile = fopen("d:\file.txt", "r") or die("Unable to open file!");
echo fgets($myfile);
fclose($myfile);
?>
</div>
</body>
</html>

Use __DIR__ or dirname(__FILE__) to open file using fopen. __DIR__ with give you directory path of current folder. Assuming you have text file in same project folder, so your code should be

fopen(__DIR__."/path/to/file/file.txt", "r")