I have an image(1st) and text on the image.I have used some codes to change the 1st image to 2nd image after clicking it and return back to orignal image after clicking on the 2nd image again.
The position of the 2 images and the text in the div are positioned in such a way that the text comes on the image.
Now the problem is when I click on the image to get other image the text disappears. Is there any way I can keep the text always visible no matter which image it is using only html and css?. I cant change the position of the image also. It has to be in that position. Is there any other way to keep that text in that position without using div?
CSS:
.checkbox { display: none; }
.label {
display: inline-block;
width: 441px;
height: 243px;
left:289px;
top:629px;
position:absolute;
background: url(images/first.png);
}
.checkbox:checked + .label {
width: 471px;
height: 277px;
left:268px;
top:611px;
position:absolute;
background: url(images/second.png);
}
.text {
width:352px;
height:183px;
left:324px;
top:664px;
position:absolute;
}
HTML:
<div class="text">
<p> some text</p>
</div>
<input type="checkbox" class="checkbox" id="checked"/>
<label class="label" for="checked" ></label>