habanero25 Posted October 22, 2007 Share Posted October 22, 2007 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 Thank you in advance! Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 22, 2007 Share Posted October 22, 2007 What do you mean by but it is unmanipulated by the CSS file What is being shown on your screen? What are you expecting? What is the CSS definition of the class? Ken Quote Link to comment Share on other sites More sharing options...
habanero25 Posted October 22, 2007 Author Share Posted October 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 22, 2007 Share Posted October 22, 2007 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 Quote Link to comment Share on other sites More sharing options...
habanero25 Posted October 22, 2007 Author Share Posted October 22, 2007 Thank you very much Ken, you were right in that the error lied in the CSS file. I had forgotten to put a # in front of the class name. Looks like I should have paid more attention is CSS class.... Thanks again! Habanero Quote Link to comment 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.