Jump to content

External style sheet


astough
 Share

Recommended Posts

I am trying to convert my old website into a CSS format. Part of the reason that I want to use the external style sheet is so I can change my links in the style sheet, and have it filter into the other pges automatically. I have heard that this is possible but I haven't been able to find information on how to do this. Can someone tell me if this is really possible, and if so how?Thank you

Link to comment
Share on other sites

You will be able to change the 'style' of the links using an external CSS file, but not the destination of the links. In order to make a 'module' which gets added to each page you serve to clients, check out using a php 'include'. This will allow you to adjust the links and have them displayed on every page which has the 'include' file 'included' in it.Similar to a CSS file, the div for the links can be defined and altered external to the pages and then when you 'include' them, they get added to the page being presented to the client requesting them. This makes modifying multiple pages on your site quite easy. You will need to have a Hosting service which offers php and rename your files to have a php extension (or mod your .htaccess file to parse as php).

Link to comment
Share on other sites

Ummm, try the w3schools php section first and then post back here once you have that under control. By then I might have found another spot to check out.http://www.w3schools.com/php/php_includes.aspYou might have to read the Tutorial modules before that one on the reference list to better understand the whole process.

Link to comment
Share on other sites

I just received an e-mail from my e-mail hosting service. I don't have a package that supports php. They only have php packages for Linux. I appriciate the help, and I will check out the php page, and maybe by my next big update, I will be able to get a new hosting service, and I will be able to do what I want.

Link to comment
Share on other sites

I just received an e-mail from my e-mail hosting service. I don't have a package that supports php. They only have php packages for Linux. I appriciate the help, and I will check out the php page, and maybe by my next big update, I will be able to get a new hosting service, and I will be able to do what I want.
You can do includes in asp as well, if your host supports that and I think you can also do them in SHTML but I've never actually tried to do it myself.
Link to comment
Share on other sites

you can do includes even if your host only supports HMTL. the pages would have to have a .shtml extension butthen you could use <!-- #include file="filename.html" -->
I am completely lost. If I understand correctly I change all of my pages to .shtml, then put the <!-- #include file="filename.html" --> in and it will bring something up. Would "filename.html" be a regular html file that has what I want to repeat in it? Also this looks like it is just a comment, is that the exact format? Where would I put the <!---Include---> in the pages? Do they go where I want the list of links?Sorry about being such a ditz :) . I enjoy doing my own webpages (and yes I write them from scratch in notepad), and so far have only done basic pages. I want to expand my abilities in creating webpages to stay up to date with technology. If you guys can bear with the stupid questions, I would be very grateful.Thanks again for the help you have all given me so far.
Link to comment
Share on other sites

I am completely lost. If I understand correctly I change all of my pages to .shtml, then put the <!-- #include file="filename.html" --> in and it will bring something up. Would "filename.html" be a regular html file that has what I want to repeat in it? Also this looks like it is just a comment, is that the exact format? Where would I put the <!---Include---> in the pages? Do they go where I want the list of links?Sorry about being such a ditz :) . I enjoy doing my own webpages (and yes I write them from scratch in notepad), and so far have only done basic pages. I want to expand my abilities in creating webpages to stay up to date with technology. If you guys can bear with the stupid questions, I would be very grateful.Thanks again for the help you have all given me so far.
If the server is set properly, a file that has the the shtml extension (for example "file.shtml") will not be sent to the browser "as is". Instead, the server will parse (simply put: "go over") it and look for the special commands (usually starting with "<!-- #" and ending like a comment- "-->") and execute them. The result after the execution of those commands will be given to the browser.The server uses "shtml" file extension for files containing such commands, so that it differs from a static HTML. That is, because static HTML is served faster. Otherwise, the server would have to always look in the file, even if there's nothing.If you have control over the server, you may also use another extension of your choise that would contain such commands.
Link to comment
Share on other sites

OK, I have default.shtml with the following code where I want to place my links.<td background="Images/TAblebkg008.gif" width=30% valign="top"><table border=0 width=100% valign="top"> <tr><td width=22%> <p align="Center" valign="top"> </p> </td> <td width=78% align="left" valign="top"><!-- #include="links.html" --> </td> <td><p> </p></td> </tr></table>I have also used #include fileThen I have links.html which is the following (Complete file)<html><!-New 05:13 12/08/06 ALS-><!-Header-> <head> </head><!-body-> <body background=none Link="Black" Vlink="maroon"><font face="verdana" Color="#000000" size="2"><a href="default.htm">Home</a></font></p><p align="left"><font face="verdana" Color="#000000" size="2"><a href="accounting.htm">Accounting</a></font><font face="verdana" Color="#000000" size="1"><br> - <a href="accounting.htm#coa">Chart of Accounts</a><br> - <a href="accounting.htm#financials">Financial Reports</a><br> - <a href="accounting.htm#tax">Tax Time</a><br> - <a href="accounting.htm#review">Reviews or Audits</a></font><br><font face="verdana" Color="#000000" size="2"><br><a href="payroll.htm">Payroll</a></font><font face="verdana" Color="#000000" size="1"><br> - <a href="payroll.htm#report">Reporting & delivery</a><br> - <a href="payroll.htm#extras">Extras</a></font><br><font face="verdana" Color="#000000" size="2"><br><a href="taxes.htm">Taxes</a><font face="verdana" Color="#000000" size="1"><br> - <a href="taxes.htm#income">Income</a><br> - <a href="taxes.htm#payroll">Payroll</a><br> - <a href="taxes.htm#sales">Sales</a></font><br><font face="verdana" Color="#000000" size="2"><br><a href="computers.htm">Computers</a><font face="verdana" Color="#000000" size="1"><br> - <a href="computers.htm#software">Software</a><br> - <a href="computers.htm#hardware">Hardware</a><br> - <a href="computers.htm#maintenance">Maintenance</a><br> - <a href="computers.htm#security">Security</a><br></font><font face="verdana" Color="#000000" size="2"> <br>Business</font><font face="verdana" Color="#000000" size="1"><br> - <a href="improveops.htm">Improving operations</a><br> - <a href="disaster.htm">Disaster Planning</a><br></font></body></html>Something is not working. I get a complete blank in the table I have the links in. Any Suggestions????

Link to comment
Share on other sites

Look at the source code of the page that is in the browser. Do you see the comments there? If so, then either you have some error in the include or the server is set to serve shtml pages as static html.After seeing the How To tutorial from Apache I can only suggest that your syntax is incorect. Use this:

<!--#include virtual="/links.html" -->

If you have control over the server, look at the article above as to how to enable SSIs.

Link to comment
Share on other sites

You can do includes in asp as well, if your host supports that and I think you can also do them in SHTML but I've never actually tried to do it myself.
I don't know what SHTML is either, but you can save it in some things like . . . hey? That is XHTML . . .
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...