IPB

Google Frontpage Forums Unattended CD/DVD Guide
 
Reply to this topicStart new topic
> CSS linking without using <link rel> tag?
Nerevar
post Apr 28 2008, 01:11 PM
Post #1


Junior
*

Group: Members
Posts: 59
Joined: 20-January 05
Member No.: 41458
Country Flag


I'm just curious about one thing, is there any possibility of linking a css file to the whole page (html-files, php-files etc) without adding the "<link rel="StyleSheet" href="style.css" Title="Stylesheet for my site" TYPE="text/css"> tag?

I've been reading around for a few days and I can't seem to find anything. I'm looking forward to any eventual replies :-)



Best Regards
-Nerevar
Go to the top of the page
 
+Quote Post
phkninja
post Apr 28 2008, 04:29 PM
Post #2


Advanced Member
Group Icon

Group: Supreme Sponsors
Posts: 489
Joined: 28-February 05
From: Dublin
Member No.: 45596
OS: none
Country Flag


how could you possibly link to a css wiythout using a <link tag>. the only way to have the information without the link is to embed it in the file (as far as im aware of course. But logically what method would you use, and why do you want to rid yourself of it)
Go to the top of the page
 
+Quote Post
Zxian
post Apr 28 2008, 07:31 PM
Post #3


Scroll up - see the Google bar?
Group Icon

Group: Super Moderator
Posts: 5257
Joined: 30-September 04
From: Vancouver, Canada
Member No.: 32464
OS: Vista Ultimate x64
Country Flag


The only other way I could think of is to use JS to read the CSS file, and insert it into the webcode. This would of course change it from an external style sheet to an internal one (you'd lose any CSS hierarchy you might want), but it would probably still do the trick.
Go to the top of the page
 
+Quote Post
Nerevar
post Apr 29 2008, 12:31 AM
Post #4


Junior
*

Group: Members
Posts: 59
Joined: 20-January 05
Member No.: 41458
Country Flag


My plan was to have just one style sheet over the whole page, and I'm using frames on it. Then i could just make a javascript for using css on all subpages and put it in the index file, right?



-Nerevar
Go to the top of the page
 
+Quote Post
iceangel89
post Apr 29 2008, 09:25 PM
Post #5


Advanced Member
***

Group: Members
Posts: 378
Joined: 10-February 07
From: Singapore
Member No.: 125966
Country Flag


errr... maybe @import?

CODE
<style>
@import ...;
</style>
Go to the top of the page
 
+Quote Post
geek
post Apr 29 2008, 10:05 PM
Post #6


I'm a few hundred PCs
Group Icon

Group: Super Moderator
Posts: 1172
Joined: 13-October 07
From: Oklahoma
Member No.: 158212
OS: Vista Enterprise x86
Country Flag


CODE
<style>
<?php @include(''style.css"); ?>
</style>


but that would have to be in each of the individual frames so itd be just as easy to use the <link rel="...

but seriously, dont use frames. they look like crap. your better off using includes. heres an example using PHP (very basic example just off the top of my head

CODE
<link rel="StyleSheet" href="style.css" Title="Stylesheet for my site" TYPE="text/css">
<table width="800px" blah=blah etc=etc>
<tr>
  <td width="200px" rowspan="2">
   <?php @include("lefthandmenu.htm");
  </td>
  <td width="600px">
   <?php @include("toprightheader.htm");
  </td>
</tr>
<tr>
  <td width="600px">
    <?php
            if (file_exists("pages/".$_GET['p'].".htm")) {
            @include("pages/".$_GET['p'].".htm");
            } else {
            echo "Page not found.<br>Blah Blah";
            }
       }
    ?>
  </td>
</tr>
</table>


then just add your htm pages to the /pages folder and make sure all you links goto
/page.php?p=nameofhtmfile.htm
Go to the top of the page
 
+Quote Post
Nerevar
post Apr 30 2008, 09:16 AM
Post #7


Junior
*

Group: Members
Posts: 59
Joined: 20-January 05
Member No.: 41458
Country Flag


QUOTE (geek @ Apr 30 2008, 06:05 AM) *
CODE
<style>
<?php @include(''style.css"); ?>
</style>


but that would have to be in each of the individual frames so itd be just as easy to use the <link rel="...

but seriously, dont use frames. they look like crap. your better off using includes. heres an example using PHP (very basic example just off the top of my head

CODE
<link rel="StyleSheet" href="style.css" Title="Stylesheet for my site" TYPE="text/css">
<table width="800px" blah=blah etc=etc>
<tr>
  <td width="200px" rowspan="2">
   <?php @include("lefthandmenu.htm");
  </td>
  <td width="600px">
   <?php @include("toprightheader.htm");
  </td>
</tr>
<tr>
  <td width="600px">
    <?php
            if (file_exists("pages/".$_GET['p'].".htm")) {
            @include("pages/".$_GET['p'].".htm");
            } else {
            echo "Page not found.<br>Blah Blah";
            }
       }
    ?>
  </td>
</tr>
</table>


then just add your htm pages to the /pages folder and make sure all you links goto
/page.php?p=nameofhtmfile.htm


I'll have to play around with it in a few days. I'm a little short of time (stuff to do in real life actually :-/). Happy weekend everybody (it's actually a few days of here in Norway, from the first of may to the fourth of may (2-4 is not normal holidays but it's around the weekend so we're getting a couple of extra days of vaccation :-)


-Nerevar
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 2nd December 2008 - 10:49 PM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy