Jump to content

Using CSS to adjust php


davemcc

Recommended Posts

Hello

 

I am very much new to this, I have the following prob i cant seem to work out.

 

I display a .txt file via php but i cant adjust the font etc. via CSS.

 

This is the site im working on and the php used...

 

http://mickleovercommunitycentre.co.uk/Oakwood/nnn/index.php

 

Any help would be great.

 

Thanks

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/74304-using-css-to-adjust-php/
Share on other sites

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>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.