p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 (http://p2p.wrox.com/forumdisplay.php?f=154)
-   -   Unable to set image or cursor property, Ch 12. (http://p2p.wrox.com/showthread.php?t=41711)

VictorVictor April 25th, 2006 06:44 AM

Unable to set image or cursor property, Ch 12.
 
Help please: Having 2 problems with Chapter 12: url property and cursor property.

I am using plain vanilla IE 6.0.2900.2180. (Win XP, SP2). See code below.

Anyone able to set the list-style-image url('XXXX');
property, with above configuration, in Ch 12?
For XXXX, I tried: 'download.gif', '~\images\banana.ani'

Anyone able to set the cursor property as specified in the
one-line greyed out area on page 353 to work?

Also cannot get any .ani or .cur to work as per the sentence (p. 353)
below:
 "IE 6 supports only windows native cursor formats: .cur(a
static cursor image) and .ani (an animated cursor image)."

Anyone able to do this using only IE6? Please help.

Code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">
    <link rel="Stylesheet" href="StyleSheet.css" type="text/css" media="screen" />
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1">
    <div>
        Test text
    </div>
    </form>
</body>
</html>

Style sheet:

div {cursor: url('~\images\banana.ani,'), url('pen_i.cur');
    border: thin solid black; width: 100px; height: 100px; }

Thanks.
VV




VictorVictor April 25th, 2006 07:01 AM

I omitted mentioning that the cursor property itself works fine -- i.e.:
when you specify it as a cursor ~keyword~ (crosshair, move, wait, ...).
It's only when you want to use the url to point to some file that it
doesn't work (for me).
VV


richard.york April 25th, 2006 02:38 PM

You have a few errors in the path you are specifying. Where are you getting the tilde? You're using backslashes instead of forward slashes. Also, you have a comma after the first file name.

Code:

div {
    cursor: url('/images/banana.ani');
    border: thin solid black;
    width: 100px;
    height: 100px;
}

Although it isn't spelled out as clearly as it could have been in the book, while IE does support custom cursors, I don't beleive it supports fallback cursors. I'm using a Mac at the moment, so I can't test it to be sure.

http://msdn.microsoft.com/workshop/a...ies/cursor.asp



Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html

VictorVictor April 26th, 2006 10:20 AM

Rich:
Thanks again. Problem solved.

The tilde comes from the provision for a server to consider a file 'server local',
if the file name is preceeded with a tilde.

In my trials and tribulations to get this working, it occurred to me that my
development computer is acting as my own server. Thus, inserting a tilde seemed
like a good thing to try. (Now seen as not necessary of course.)

Yup, forward slashes, backward slashes, always giving me a headache.
I did try both, but the mix of other errors precluded seeing any improvement.

The comma was because at one point I had several files specified for the possibility
of a backwards search to find something -- anything, that would work. I simply forgot
to remove the comma when I documented the problem.

One thing tho:

Your suggestion as shown above still did not work. I had to remove the forward slash in
front of the folder name to get it to work. That is:

Doesn't Work: ...... cursor: url('/images/banana.ani');
Works: ....... cursor: url('images/banana.ani');

Perhaps this is due to a difference: Mac vs. PC or IE6 idiosyncracy.

VV





richard.york April 26th, 2006 10:27 AM

> Your suggestion as shown above still did not work. I had to remove the forward slash in
> front of the folder name to get it to work. That is:

"/images/banana.ani" is an absolute path, the leading forward slash refers to the root directory.

So the full path would be "http://www.example.com/images/banana.ani", writing it as "/images/banana.ani" allows you to leave off the domain and yet refer to the root directory no matter where you are calling it from.

Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html

VictorVictor April 26th, 2006 10:49 AM

Rich:
It won't work on my computer with the forward slash in front of the folder name.
Instead it displays the black disk default.
VV




All times are GMT -4. The time now is 09:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.