Help
Search
Login
Register
Home
Forum: web design and graphics community
Celestial Star Forum
>
Web Development
>
Coding
>
Code for having an alternative stylesheet?
Pages: [
1
]
« previous
next »
Print
Author
Topic: Code for having an alternative stylesheet? (Read 1328 times)
blahdee-
Guest
Code for having an alternative stylesheet?
«
on:
July 03, 2008, 09:44:53 PM »
I don't know if you guys know what I'm talking about, but here goes!
I want to know how you can have two stylesheets on the same page (just incase the visitor has a different browser)
because all I would have on a site would be:
<link rel="stylesheet" href="style.css" type="text/css">
and a friend told me that I had to have something like this:
[if IE]
in my header to make it work?? @__@; sorry if this is confusing!
Logged
katie-kate
Incubus
Posts: 74
Re: Code for having an alternative stylesheet?
«
Reply #1 on:
July 03, 2008, 11:03:26 PM »
I know exactly what you're talking about, because my friend used to do it all the time in my webdesign class. Unfortunately I don't know how to do it myself, but I'm sure you could find some tutorials online...I do know that it's called "browser sniffing," which might help you find more information. Good luck!
Logged
Moorina
Angeling
Posts: 6
moo
Re: Code for having an alternative stylesheet?
«
Reply #2 on:
July 04, 2008, 04:24:40 AM »
I'm pretty sure you're talking about browser specific CSS (or browser sniffing). You need to add a conditional comment syntax to the <head> of your page.
Code:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->
here
is a good page to target more specific versions of IE.
Logged
blahdee-
Guest
Re: Code for having an alternative stylesheet?
«
Reply #3 on:
July 04, 2008, 11:41:03 AM »
Thank you!! It works! =DD but does it only work for IE?
--This was the layout that was giving me problems xD
http://kissandtell.reiku.org/layouts/01/
«
Last Edit: July 04, 2008, 12:06:19 PM by blahdee-
»
Logged
Moorina
Angeling
Posts: 6
moo
Re: Code for having an alternative stylesheet?
«
Reply #4 on:
July 06, 2008, 10:00:59 PM »
Not too sure if there are others. There may be one for Opera, but I think it uses Javascript.
Logged
Vangs
Administrator
Valkyrie Randgris
Posts: 523
Re: Code for having an alternative stylesheet?
«
Reply #5 on:
July 07, 2008, 06:16:53 AM »
In HTML there is only conditional comments for IE. The reason being is that all other browsers ignore these comments, they're treated like regular comments. If you want to target different browsers you'll need to look at a different browser sniffing method such as Javascript or PHP.
Personally I use PHP in my projects to deliver a stylesheet relevant to the users browser, however this becomes redundant if the user saves the page then views it in another browser -- though I personally rationalize this as the user's own problem if they save the page.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General
=> New Members
=> Announcements
=> Support / Suggestions
-----------------------------
Contests
-----------------------------
=> Archive
===> Contests
===> Blend Challenges
===> SOTW
-----------------------------
Art Boards
-----------------------------
=> Creative mediums
=> Requests & offers
=> Tutorials
===> Celestial Star Tutorials
-----------------------------
Web Development
-----------------------------
=> Coding
=> Web Design
=> Advertisements / Affiliation
-----------------------------
Off-topic
-----------------------------
=> Entertainment
-----------------------------
Español (Spanish Only)
-----------------------------
=> General / Bienvenida
=> Anuncios / Ayuda
=> Código / Desarrollo web
Welcome,
Guest
Members login
Register for free
General
General
New members
Announcements
Support / Suggestions
Art boards
Creative mediums
Requests and offers
Tutorials
Celestial Star tutorials
Web development
Coding
Web design
Advertisements / affiliation
Off-topic
The non-sense
Ententainment
Loading...