Forum Moderators: not2easy

Message Too Old, No Replies

Importing CSS and other content

         

Jay_R

5:20 am on Jul 31, 2003 (gmt 0)

10+ Year Member



What's the most efficient way to import style sheets? I have run into the <link rel...> and the @import methods.
Also,
Can these methods be used for importing other content into the html file, such as the coding for a menu bar or a changing heading? Or are there other more efficient methods such as server side includes. I'm trying to keep this site simple yet dynamic without jumping into ASP, CGI, or java scripting. I'm saving those delicious areas for another day.
As always, I appreciate any help.

-Jay :)

DrDoc

6:50 am on Jul 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The best way to go is using PHP. It's easy enough to learn for simple tasks like that.

<?php
include("path/to/file.php");
?>

It doesn't have to include a PHP file either...

Jay_R

3:44 pm on Jul 31, 2003 (gmt 0)

10+ Year Member



Thnks, that does seem cleaner than having to deal with .shtml files, are there any other advantages? Know of any preffered PHP resources on the web? Can this be used to import stylesheets too? Thanks again...
Jay :)

drbrain

3:46 pm on Jul 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only difference between using @import and <link> is that with @import you cannot declare alternate style sheets [w3.org].

If you include the CSS directly in a <style> block via a PHP include, you'll be wasting bandwidth, because the CSS will (hopefully) not be changing on every page request.

You'll need to use a scripting language (Ruby, PHP, etc.) for including other items like menu bars and headers.

Jay_R

6:42 pm on Jul 31, 2003 (gmt 0)

10+ Year Member



Thnks again, your time is much appreciated. I thought I had a handle on most of the used scripting languages, but I've never heard of Ruby. I have done some programming in the past, so I feel like i could pick up a scripting language fairly quickly, but with so many out there I really don't know where to start. Can you offer any advice?

Again, thanks for the help.

Jay :)