how can I add a button and set a link of middle of the image | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how can I add a button and set a link of middle of the image

19th Oct 2016, 9:31 AM
tarak
tarak - avatar
2 Answers
+ 2
Something like this: <style type="text/css"> p {position: absolute; left:20px; top:25px;} button {position: relative; padding:0;} </style> <button type="button" onClick='location.href="#"'><img src="img.jpg" width="100" height="100"></img> <p>Some text</p> </button> This is button-image, leading to the link. Text superimposed on the picture. The image must be set to position:relative, and text to position:absolute. The text should be aligned.
19th Oct 2016, 5:36 PM
Nadezhda
+ 2
thanks, very helpful
19th Oct 2016, 5:41 PM
tarak
tarak - avatar