Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ![]() Interested in joining? Click here. If you are already a member of ZBCode, feel free to login right here: |
| [Completed] [ZB] Multiple Stylesheets | |
|---|---|
| Tweet Topic Started: Sep 19 2009, 08:25 PM (275 Views) | |
| Ava | Sep 19 2009, 08:25 PM Post #1 |
|
A.V.A
![]()
|
Hey. I was wondering if there's a way to add more stylesheets like : <link rel="stylesheet" type="text/css" href=".css" /> : to my board, but so that it only works on specific pages of my board. Is there a way to somehow enter it before ANY of the page content loads, and only have it active on certain pages? (FYI : These certain pages are webpages! However, I've tried posting it in the HTML section of the webpage editor, and it does not load before some of the page content, which tends to ruin the flow of the webpage.) Note : I would like the specific elements defined in the new stylesheets to overwrite the similar ones in the original. Thanks in advance. Ava Edited by Ava, Sep 19 2009, 08:29 PM.
|
| |
![]() |
|
| Firestrife2 | Sep 19 2009, 08:41 PM Post #2 |
![]()
|
See if this goes faster, put in "Javascripts" which is at the very top. I'm not 100% sure it will work, so test it out for me eh?
Just edit the red and blue. |
![]()
| |
![]() |
|
| Ava | Sep 19 2009, 09:46 PM Post #3 |
|
A.V.A
![]()
|
Works like a charm ![]() Is there a way for me to add multiple stylesheets to different pages with this script, without having to paste it 13 times (that's how many pages I need to assign stylesheets to)? If it helps at all : It's the same stylesheet I'd like to add to all 13 pages. Edited by Ava, Sep 19 2009, 11:49 PM.
|
| |
![]() |
|
| Gorgor | Sep 20 2009, 05:26 AM Post #4 |
|
Hello
![]()
|
Well first off, you don't need the slashes as that indicates a RegExp, quotes are better. For multiple pages, use
|
![]() |
|
| Ava | Sep 20 2009, 06:07 AM Post #5 |
|
A.V.A
![]()
|
Gorgor I've tried your version of this code, and replaced the "PAGE URL" text with the page URL's, and it does not work. I have 13 of these pages. Perhaps that is too many to work with this code. I'm positive my css works, granted it works with Firestrife's code, however. Ava Edited by Ava, Sep 20 2009, 06:09 AM.
|
| |
![]() |
|
| Gorgor | Sep 20 2009, 06:36 AM Post #6 |
|
Hello
![]()
|
Can I see the exact code you're using please? at the end, the code should look like this... With two parenthesis', not one. Edited by Gorgor, Sep 20 2009, 06:37 AM.
|
![]() |
|
| Firestrife2 | Sep 21 2009, 05:41 AM Post #7 |
![]()
|
When using quotes, I thought you had to enter the whole URL most of the time xD? As I said, I always prefer regexp. You could also do the same that way. if(location.href.match(/pages\/\PAGENAME/i) || location.href.match(/pages\/\PAGE2NAME/i)){ :3. |
![]()
| |
![]() |
|
| Cory | Sep 21 2009, 02:15 PM Post #8 |
![]()
|
There's also this if you don't wish to use JavaScript. |
| |
![]() |
|
| Ava | Sep 23 2009, 12:03 PM Post #9 |
|
A.V.A
![]()
|
This request is complete. Thanks! |
| |
![]() |
|
| Reid | Sep 23 2009, 12:29 PM Post #10 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
You're welcome. See? We can read thoughts too. ;) Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first! Thanks, The ZBCode Staff |
| The Resource Board | |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Completed Requests · Next Topic » |






















2:27 PM Jul 11