Jump to content

[SOLVED] A little PHP/CSS help please...


habanero25

Recommended Posts

Hello,

 

I'm trying to manipulate some strings that I extract from a text file with CSS, but it doesn't seem to be working very well. Here is the code:

 

   	<div id = "80text">                //name of css div
<?php
	$lines = file("info.txt");   //grabs lines from info.txt 
                echo $lines[3];              //Echo the n-th array value
        ?>
</div>

 

When I check out the result, the text from the .txt file appears, but it is unmanipulated by the CSS file. I know the php file is reading the css file properly because other properties, like background-color, work perfectly.

 

I apologize if this has been asked before, but I'm very new to PHP  :P

 

Thank you in advance!

Link to comment
https://forums.phpfreaks.com/topic/74268-solved-a-little-phpcss-help-please/
Share on other sites

Sorry, let me be a little more clear. When I test the .php page, all I see is line 3 of the .text file, which simply reads "hello, how are you?". I tried putting the output into a div wrapper called "80text", which is coded as follows, in an external CSS file:

 

80text{
border:none;
width:235px;
height:300px;
top:300px;
left:455px;
position:absolute;
color:#FFFFFF;
font:Verdana, Arial, Helvetica, sans-serif;
}

 

By "but it is unmanipulated by the CSS file" I meant that the div "80text" is not changing the properties of the text "hello, how are you?". I am expecting the text to be in white font, in Verdana font, and be located at location (300,455) on the screen. However I am only seeing "hello, how are you?" in its default color, font, and location.

 

This looks like an error in you CSS class definition.  Class names are preceded with a "." in the CSS file, you don't seem to have one. Also, I'm not sure if the CSS name can start with a number, try this instead:

.text80{
border:none;
width:235px;
height:300px;
top:300px;
left:455px;
position:absolute;
color:#FFFFFF;
font:Verdana, Arial, Helvetica, sans-serif;
}

 

Ken

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.