Click to See Complete Forum and Search --> : html stylesheets


bmass
07-13-2006, 04:42 PM
Hey, in efforts to get custom cursors working with firefox I needed to change the cursor source file to a .gif, and I have done that using a CSS stylesheet. My problem is that Internet Explorer will only accept cursors that are some sort of cursor file (either .cur or .ani). I have found one ressolve that will allow me to have custom cursors with both IE and Firefox. This is to iniate the .gif custom cursors using CSS for firefox, and then adding <body style="cursor: url('images/cursor.ani)"> and for all the links using <a style="cursor: url('images/cursor.ani)" href="http://www.url.com">.

However, as you can probably tell, adding the style to every single link is a little more than a hassel. So I am wondering if there is any kind of stylesheet that I can do with HTML, similar to CSS, so that I can iniate style="cursor: url('images/cursor.ani)" on every link the same as can be done with CSS. Thanks.

thoughtcube
07-13-2006, 05:01 PM
Perhaps I don't understand the question, but why not have a CSS file, that all your pages use, containing

body {
cursor: url('images/cursor.ani)"
}

a {
cursor: url('images/cursor.ani)"
}

?

bmass
07-13-2006, 05:24 PM
Because I already have one that it used to initiate a cursor code for firefox using the .gif images. I can't initiate the .gif cursors and the .ani cursors both in CSS. Basically I need to have the same cursor twice, one as a picture file (for firefox) and another as a cursor file (for IE). I've tried to have the code for both in my stylesheet but it will not work. One needs to be in html and another in CSS.

thoughtcube
07-13-2006, 05:33 PM
How about having a different stylesheet for each browser? Lots of sites do that, for such problems.

bmass
07-13-2006, 05:44 PM
how could I do that? Just <link rel="stylesheet" type="text/css" href="style.css"> and then another one right after linking to a differnet stylesheet? And also, would that work with a forum? Because I have the cursors thrown into the stylesheet.

thoughtcube
07-13-2006, 05:50 PM
The way I've seen it done is to dynamically create the <link rel ...> (but there may be other ways). I mean, have in your header javascript code that uses document.write() to create an appropriate <link rel ...>, according to the browser.

bmass
07-13-2006, 06:09 PM
How do you dynamically create a <link rel...>? And I don't really know much javascript, the only javascript I've used has been directly copied.

ray326
07-13-2006, 11:42 PM
IE has conditional statements that could be used to follow up the GIF cursor declaration with a cur/ani cursor declaration if the browser is IE.

thoughtcube
07-14-2006, 12:42 AM
Here is an example of what you want:

different stylesheets for different browsers (http://www.scriptygoddess.com/archives/2002/06/28/load-different-stylesheet-based-on-browser/)