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

 

Link to comment
Share on other sites

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

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.