Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS linking without using <link rel> tag?

Featured Replies

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

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)

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.

  • Author

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

<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

<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

  • Author
<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

<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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.