jayson Posted December 3, 2005 Posted December 3, 2005 I am slowly learning CSS, but not how to serch the web. This is my problem: I have 12 pages, I want on my .CSS form, to have "site was ast updated on xx.xx.xxxx" and I want that to reflect on all my pages, is there a way to do that on a .css page? like: style.css page .update { echo"site was last updated on 12/3/2005"} webpage .update or am I way in left field? Thanks Quote
TCH-Bruce Posted December 3, 2005 Posted December 3, 2005 I don't think you can do that with .css but you can with PHP by creating a .php file with the echo statement in it. Then in all of you pages you would need to add an "include" statement for the .php file. Quote
jayson Posted December 3, 2005 Author Posted December 3, 2005 I barely know how to write a css page--I don't know how to write a php. Can I make a php act like a css, and if so, can you give me an example? This is my css form right now: body { background-color: lightblue; font-family: Arial, Verdana, sans-serif; font-size: 16px; color: black; } pre { font-family: Arial, Verdana, sans-serif; font-size: 16px; color: black;} H1 { text-transform: uppercase; font-size: 60px; color: purple;} A:link { color: blue } /* unvisited links */ A:visited { color: red } /* visited links */ A:hover { color: yellow } /* user hovers */ A:active { color: lightblue } /* active links */ H1 {color: purple;} Thanks, Jayson Quote
TCH-Bruce Posted December 3, 2005 Posted December 3, 2005 The file will contain standard HTML code. Last updated xx-xx-xxxx If this file were called lastupd.html you would add the include in your web page where you wanted the message to appear like so. ><?php include $_SERVER['DOCUMENT_ROOT']."/lastupd.html"; ?> You would script your CSS for the class of that paragraph. Since I am showing an example of using PHP includes and you are probably using HTML or HTM for your file extensions you will have to add the following line to your .htaccess file of the folder containing these files so that the server can parse the HTML like a PHP document. >AddType application/x-httpd-php .htm .html Hope that helps Quote
jayson Posted December 4, 2005 Author Posted December 4, 2005 ok, I read the message 5 times, I think I either need to learn php or give up the idea to do what I want it to do. So thanks Bruce for you time and efford.. any ideas on a good book to learn php? Quote
TCH-Bruce Posted December 4, 2005 Posted December 4, 2005 PHP and MySQL for Dummies (it's a Dummies book) That was not meant to be derogatory. It's the book I started with. Plenty of examples in it. Quote
TCH-Bruce Posted December 4, 2005 Posted December 4, 2005 There is a very good Getting Started with PHP Tutorial written by one of the TCH members I think you should read. The concept for what you are wanting to do is very similar. Quote
jayson Posted December 4, 2005 Author Posted December 4, 2005 PHP and MySQL for Dummies (it's a Dummies book) That was not meant to be derogatory. It's the book I started with. Plenty of examples in it. no offense taken, I have a lot of those books: sex for dummies Quote
TCH-Dick Posted December 4, 2005 Posted December 4, 2005 OK guys, I had to do some digging on this one. It is possible BUT is does not work in IE. Just use the CSS content property. ><html> <head> <style type="text/css"> <!-- p.update:after {content: "site was last updated on 12/3/2005"; } --> </style> </head> <body> <p class="update"></p> </body> </html> Quote
jayson Posted December 4, 2005 Author Posted December 4, 2005 ok, came to two conclusions 1] i am an idiot 2] i will be getting a php book Quote
jayson Posted December 4, 2005 Author Posted December 4, 2005 ok, plan B, going to add a footer my frames Quote
stevevan Posted December 4, 2005 Posted December 4, 2005 Just remember we've all been there Jayson. Since it appears that you are quite the newbie, I would recommend the "Dummies" book. I have several of them and they are quite good at explaining things in a way that you'll remember them. Quote
jayson Posted December 6, 2005 Author Posted December 6, 2005 ok, I am back, I need a little help, I have a folder called 1234 (that is where my .html file is) then that folder is in 5678 anf finally that folder is in 9012. in folder 9012 is my style.css, in the HTML file, how do I link to the style sheet, this is what I have tried: <LINK REL="ALTERNATE STYLESHEET" TYPE="text/css" HREF="[use full url of stylesheet location]"> <LINK REL="STYLESHEET" TYPE="text/css" HREF="./style.css"> <LINK REL="STYLESHEET" TYPE="text/css" HREF="././style.css"> <LINK REL="STYLESHEET" TYPE="text/css" HREF="1234/5678/9012/style.css"> <LINK REL="STYLESHEET" TYPE="text/css" HREF="../style.css"> Ok the question is, what I doing wrong. Thanks Quote
TCH-Don Posted December 6, 2005 Posted December 6, 2005 Why not just put the style sheet in the same folder as your html pages ><link rel="stylesheet" type="text/css" href="style.css" /> or use the full url ><link rel="stylesheet" type="text/css" href="http://my-tch-site.com/style.css" /> Quote
jayson Posted December 6, 2005 Author Posted December 6, 2005 Why not just put the style sheet in the same folder as your html pages ><link rel="stylesheet" type="text/css" href="style.css" /> or use the full url ><link rel="stylesheet" type="text/css" href="http://my-tch-site.com/style.css" /> you know after all I went thru, you did what I was trying to do.. Thanks, the second code worked Quote
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.