I'm new to CSS. The tutorials taught me, that settings defined in the upper part of the css file are overwritten by the settings defined below. Now I try to create a custom cursor for my whole page, which is animated while clicking on a link. My code looks like this:
* {
cursor: url("../dartpfeil.cur"), auto;
}
...
.menu a:active {
cursor: url("../dartpfeil_steckt.cur"), auto;
}
But this doesn't work. The cursor defined in the * section works, but if I click on the menu link, the cursor doesn't change. If I delete the * section and add the following code:
.menu a:hover {
cursor: url("../dartpfeil.cur"), auto;
}
it works, but the "dartpfeil.cur" cursor is only shown by hovering the links. I also tried
*:hover {
cursor: url("../dartpfeil.cur"), auto;
}
but then the cursor is also only shown by hovering a link. I want to use the "dartpfeil.cur" on the whole page as if it is defined in *, but i want also the "dartpfeil_steckt.cur" while link is active. Is there any possible solution for this problem?
Thanks and a happy new year to all!
EDIT: Error in code fixed
EDIT2: As asked, the html code below:
<html>
<head>
<title>Dartverein XY</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<a href="index.php" id="headerLink">
<section id="header">
<div id="title">Steeldartverein<br>Mühldorf e.V.</div>
</section>
</a>
<div class="horizontalBorder"></div>
<section class="menu">
<p class="verticalBorder"></p>
<a href=""><div class="menuElementRed">News</div></a>
<p class="verticalBorder"></p>
<a href=""><div class="menuElementGreen">Über uns</div></a>
<p class="verticalBorder"></p>
<a href=""><div class="menuElementRed">Weiteres</div></a>
<p class="verticalBorder"></p>
<a href=""><div class="menuElementGreen">Login</div></a>
<p class="verticalBorder"></p>
<p class="lastVerticalBorder"></p>
</section>
<div class="horizontalBorder"></div>
</body>
</html>
Does "dartpfeil_steckt.cur" work for *? Your code looks fine, and it should override the wildcard because it's more specific. My best guess is that you have misplaced the file, or misspelled the filename.