Hello,
I've purchased Ascendent membership yesterday, so I've been trying to learn CSS for my campaign. I've managed to do simple stuff, but it's still kind of a mess.
For my wiki, I'm trying to use image links that change on hover by using two different images.
Here's what I have so far (I found the code on stackoverflow), but the CSS appears like normal text on the page, and the image link is not there. What am I missing ? Can't we mix HTML and CSS ?
Sorry if I made super dumb mistakes, I don't understand CSS well yet.
<a href="https://poudlardetlamagiedesfondateurs.obsidianportal.com/wikis/aventures" class="aventures"></a>
.aventures {
display:block;
width: 500px;
background: url('https://i.imgur.com/oicf9eF.png') ;
}
.aventures:hover {
display:block;
width:500px;
background-image: url('https://i.imgur.com/NODzJyE.png');
}
Thanks in advance
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
My code is so barbaric, the best I can reccomend is for you to use the inspect function of your browser, and check out my main wiki menu.
The boxes change on hover, and as I recall, it was based on switching images.
https://unconquered-kingdoms.obsidianportal.com/wikis/main-page
Unconquered Kingdoms, July 2016 CotM
Thank you ! I managed to do what I wanted using some of your code and mixing it with codes from other places.
I had not understood that the parts where we define new classes are supposed to be in the general campaign CSS !
I still have some problems : the image moves on hover, and the scroll-background doesn't repeat (but only on this page), so if you have suggestions for that I would be grateful.
I think the images aren't recognized as "main content", so the background doesn't repeat for them. I tried with text and it does repeat.
What I put in the campaign CSS :
Here's what's on the page :
And here's the result
I believe a clunky fix would be to put breaks in the article itself to push the bottom of the article below your menu boxes.
Unconquered Kingdoms, July 2016 CotM
That's what I did on my home page and my main wiki page and it seems to be working, thanks !
I'm still going to try and figure out why this happens though.
Looks very nice.
Unconquered Kingdoms, July 2016 CotM