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 Quote 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> Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.