davemcc Posted October 11, 2007 Share Posted October 11, 2007 Hello, can anyone help me? I am using the follwing to display the contents of try.txt. It displays fine but I cannot alter the font via CSS, any ideas? Also I need the displayed txt to wordwrap within its DIV but i cannot figure it out! <?php $lines = file("try.txt"); echo '<pre>'; foreach($lines as $line) echo str_replace("<", "<", $line)."\n"; echo '</pre>'; ?> Any help would be great! Many thanks Dave Link to comment https://forums.phpfreaks.com/topic/72761-formatting-displayed-txt-css-and-wordwrap/ Share on other sites More sharing options...
benji87 Posted October 11, 2007 Share Posted October 11, 2007 Just set your style with a css file. for example #textcontainer { font-family: verdana, arial, serif; }; Then in your page where u want to echo the text you just need to echo it inside a div tag like so: <div id="textcontainer"> <?php echo "$lines" ?> </div> Link to comment https://forums.phpfreaks.com/topic/72761-formatting-displayed-txt-css-and-wordwrap/#findComment-366936 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.