Jump to content

Recommended Posts

Posted

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 ;)

Posted

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.

Posted

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

Posted

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

Posted

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?

Posted
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

Posted

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>

Posted

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.

Posted

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

Posted

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" />

Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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