Jump to content

Using CSS to adjust php


davemcc

Recommended Posts

From the link you supplied I see you are using the following code to grab the news from text file:

<?php
lines = file("news.txt");
foreach($lines as $ln) {
  echo "$ln<br />";
}
?>

 

You'll want to wrap that code in some div tags and then give the div an id of news. That way you can then style the text how you

want it to display.

 

Example Code:

<style type="text/css">
#news { color: #F00;
border: 2px solid #333;
padding: 10px;
font: 12px Arial; }
</style>

<div id="news">
<?php
$lines = file("news.txt");
foreach($lines as $ln) {
  echo "$ln<br />";
}
?></div>

Link to comment
Share on other sites

Thanks for that!

 

I can now alter text but the border still remains...

 

I am doinhg this for a Community Centre website. I basically want to display .txt files in divs, borderless but be able to constrain the width the txt is diplayed at.

 

Any help would be great as im a bit lost!

 

Thanks

 

Dave

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.