Hello, I'm using Moodle 2.4.1 and have created a custom theme called dspt based on the base theme provided with the install package.
I am trying to create a css tooltip that will allow my students to pass a mouse over the word "answer" and display an answer for practice questions they will be asked to do in their lessons.
I've tried adding the css to the head section, and creating a css file called dspt.css, which I have installed into the style directory of my custom theme. Note I did not do both at the same time, but tried it in both places with the same results.
Here's the CSS I coded:
/* tooltip styling */
.dspttooltip {
cursor:help;
margin: 2px;
color: red;
font-weight:bold;
font-size: 13px;
position:relative;
text-decoration:none;
z-index:20;
}
.dspttooltip span {
display:none;
text-decoration:none;
}
.dspttooltip:hover {
z-index:21;
}
.dspttooltip:hover span {
display:block;
width:250px;
border-color: #808080;
border-style: ridge;
border-width: 2px;
border-radius:6px;
padding:5px;
color:#000;
background:#ffff80;
text-decoration:none;
font-size:13px;
font-weight:normal;
text-align: left;
position:absolute;
padding:2px;
top:20px;
left:-10;
-moz-box-shadow: 2px 2px 11px #666;
-webkit-box-shadow: 2px 2px 11px #666;
}
And the HTML in the book I've created:
<div><span style="font-weight: bold;">2.</span> Question? <a href="#" class="dspttooltip">Answer<span>Blah, blah,blah</span></a></div>
What I want to see is the "Question", followed by Answer in red. When the student hovers over "Answer", the cursor should change to the help cursor, and a stylish tooltip should be displayed containing "Blah,blah,blah".
What I'm seeing is "Question", followed by "Answer" and then the answer. Neither the colour, the cursor, or the style for the tooltip have been recognized.
I have had success getting this to work standalone on cssdesk.com, but can't get it to work in Moodle.
Sorry, I tried to upload a screenshot but can't for some reason.
I can give anyone access to my moodle if need be.
Can anybody tell me if I'm missing something? Also what is the best place to put this type of code, in the <head> section, or in the dspt.css file in the theme?
Many thanks in advance,
Barb